VERSION 5.00 Begin VB.Form Form1 Caption = "TextCLN" ClientHeight = 3195 ClientLeft = 60 ClientTop = 345 ClientWidth = 4680 Icon = "clnfrm.frx":0000 LinkTopic = "Form1" ScaleHeight = 3195 ScaleWidth = 4680 StartUpPosition = 3 'Windows の既定値 Begin VB.CommandButton endbtn Caption = "end" Height = 1335 Left = 600 TabIndex = 8 Top = 0 Visible = 0 'False Width = 1335 End Begin VB.ComboBox j1cmb Height = 300 Left = 0 TabIndex = 7 Text = "Combo1" Top = 1440 Width = 1695 End Begin VB.Frame Frame1 Height = 975 Left = 0 TabIndex = 4 Top = 360 Width = 1815 Begin VB.OptionButton slidingclnopt Caption = "SlidingCLN(&S)" Height = 375 Left = 120 TabIndex = 6 Top = 480 Width = 1575 End Begin VB.OptionButton verticalclnopt Caption = "VerticalCLN(&V)" Height = 375 Left = 120 TabIndex = 5 Top = 120 Width = 1575 End End Begin VB.CommandButton outputbtn Caption = "OutPutCLN(&O)" Height = 615 Left = 120 TabIndex = 3 Top = 2520 Width = 1575 End Begin VB.CheckBox uruuchk Caption = "Feb 29th ON(&F)" Height = 300 Left = 120 TabIndex = 2 Top = 120 Width = 1575 End Begin VB.CommandButton gobtn Caption = "MakeCLN(&M)" Height = 615 Left = 120 TabIndex = 1 Top = 1920 Width = 1575 End Begin VB.TextBox Text1 BeginProperty Font Name = "MS ゴシック" Size = 9 Charset = 128 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 3255 Left = 1920 MultiLine = -1 'True ScrollBars = 3 '両方 TabIndex = 0 Text = "clnfrm.frx":030A Top = 0 Width = 2775 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Rem ----------- Rem TextCLN clender TXT output program. Rem kaz_kimijima@livedoor.com http://kimijima.tripod.co.jp Rem ----------- Dim monthkind As Integer Dim weekdaykind As Integer Dim vschr As String Public Sub form_load() verticalclnopt.Value = False slidingclnopt.Value = True Text1.Text = "" Rem --Jun 1thDay'sweekdaykind initizing.----- weekdaykind = 0 j1cmb.Text = "Jun1thday'skind." With j1cmb .AddItem ("SAN") .AddItem ("MON") .AddItem ("TUE") .AddItem ("WED") .AddItem ("THU") .AddItem ("FRI") .AddItem ("SAT") End With End Sub Public Sub j1cmb_click() weekdaykind = j1cmb.ListIndex End Sub Public Sub endbtn_click() Unload Me End Sub Public Sub outputbtn_click() Set fso = CreateObject("scripting.filesystemobject") If fso.fileexists("ycoldbak.txt") = True Then fso.deletefile ("ycoldbak.txt") End If If fso.fileexists("year-cln.txt") = True Then fso.copyfile "year-cln.txt", "ycoldbak.txt" fso.deletefile ("year-cln.txt") End If Set writetextstream = fso.createtextfile("year-cln.txt") writetextstream.write (Text1.Text) writetextstream.Close End Sub Public Sub gobtn_click() Text1.Text = "" weekdaykind = j1cmb.ListIndex If weekdaykind < 0 Then weekdaykind = 0 If verticalclnopt.Value = True Then vschr = vbCrLf Else vschr = "" End If If slidingclnopt.Value = True Then Text1.Text = " SN MN TU WD TH FR ST" & vbCrLf For prespace = 0 To weekdaykind If prespace = 0 Then Rem nodoing. Else For threespace = 1 To 3 Text1.Text = Text1.Text & " " Next threespace End If Next prespace End If Rem ----- monthkind = 1: Call ml(":January------------") monthkind = -2 If uruuchk.Value = 1 Then monthkind = -1 Else: monthkind = -2 End If Call ml(":February-----------") monthkind = 1: Call ml(":March--------------") monthkind = 0: Call ml(":April--------------") monthkind = 1: Call ml(":May----------------") monthkind = 0: Call ml(":June---------------") monthkind = 1: Call ml(":July---------------") monthkind = 1: Call ml(":August-------------") monthkind = 0: Call ml(":September----------") monthkind = 1: Call ml(":October------------") monthkind = 0: Call ml(":November-----------") monthkind = 1: Call ml(":December-----------") Text1.Text = Text1.Text & vbCrLf & "------------------------------" End Sub Public Sub ml(monthstr As String) Dim tmpstr As String Dim weekendlimitterstr, daycrlfchr As String If verticalclnopt.Value = True Then daycrlfchr = vbCrLf If slidingclnopt.Value = True Then daycrlfchr = "" For i = 1 To 30 + monthkind Rem If 7 < i Then monthstr = "" tmpstr = Str(i) If Len(tmpstr) < 3 Then tmpstr = " " & tmpstr End If If verticalclnopt.Value = True Then If i = 1 Then Text1.Text = Text1.Text & monthstr & vbCrLf End If End If Text1.Text = Text1.Text + tmpstr + daycrlfchr If weekdaykind = 6 Then If verticalclnopt.Value = True Then weekendlimitterstr = "" If slidingclnopt.Value = True Then If i < 7 + 1 Then weekendlimitterstr = monthstr If 7 < i Then weekendlimitterstr = "" End If Text1.Text = Text1.Text + weekendlimitterstr + vbCrLf End If weekdaykind = weekdaykind + 1 If weekdaykind = 7 Then weekdaykind = 0 Next i Rem ----- End Sub