Dim SY1 As Single, SM1 As Single, SD1 As Single Dim SY2 As Single, SM2 As Single, SD2 As Single Rem 瀬戸 Rem Biorithm Private Sub Form_Load() Visible = True: AutoRedraw = True Dim Y As String, SD As Long, I As Integer Dim IX As Single, SN As Integer, KN As Integer, SI As Integer Do Cls: Scale (-6, 50)-(186, -50) CurrentX = 0: CurrentY = 50 SY1 = InputBox("生まれた西暦年"): SM1 = InputBox("生まれた月") SD1 = InputBox("生まれた日") SY2 = InputBox("見たい西暦年"): SM2 = InputBox("見たい月") Form1.ForeColor = QBColor(9): Print "BODY" Form1.ForeColor = QBColor(12): Print "MIND" Form1.ForeColor = QBColor(10): Print "INTE" Form1.ForeColor = QBColor(0) Line (-3, 0)-(183, 0) For I = 1 To 30 If (I Mod 5) = 0 Then Line (-3 + I * 6, -50)-(-3 + I * 6, 50) Else Line (-3 + I * 6, -2)-(-3 + I * 6, 2) End If Next I SD2 = 1 NISSU SD SN = (SD Mod 23): KN = (SD Mod 28): SI = (SD Mod 33) For IX = -1 To 30 Step 0.1 PSet (6 * IX + 3, 40 * Sin((IX + SN) / 23 * 6.28)), QBColor(9) PSet (6 * IX + 3, 40 * Sin((IX + KN) / 28 * 6.28)), QBColor(12) PSet (6 * IX + 3, 40 * Sin((IX + SI) / 33 * 6.28)), QBColor(10) Next IX Y = InputBox("もう一度 (Y/N)") If LCase(Y) <> "y" Then Exit Do Loop CurrentX = 160: Print "seto" Rem form1.printform End Sub Sub NISSU(SD As Long) Dim WY1 As Long, WM1 As Long, WY2 As Long, WM2 As Long WY1 = SY1: WM1 = SM1: WY2 = SY2: WM2 = SM2 If SM1 = 1 Or SM1 = 2 Then WM1 = SM1 + 12: WY1 = SY1 - 1 If SM2 = 1 Or SM2 = 2 Then WM2 = SM2 + 12: WY2 = SY2 - 1 SD = TWODATES(WY2, WM2, SD2) - TWODATES(WY1, WM1, SD1) End Sub Function TWODATES(Y As Long, M As Long, D As Single) As Long TWODATES = Int(365.25 * Y) + Int(Y / 400) - Int(Y / 100) + Int(30.59 * (M - 2)) + D End Function |
作業
ポイント
IF 「条件」 Then 条件が真のとき命令文1を偽の時は命令文2を実行する。
「命令文1」 Else 「命令文2」 Endif
注意