سلام اشکال این برنامه چیه ؟ (یه برنامه قفل رمز با قابلیت تغییر رمز هستش) :cry2:
Config Porta = Output
Dim A As Byte
Dim B As Byte
Dim C As Byte
Dim F As Byte
Main:
Cls
Locate 1 , 1
Lcd "Input code = 1"
Locate 2 , 1
Lcd "Change code = 2"
Goto P
End
P:
F = Getkbd()
If F > 15 Then Goto P
Else
Lcd F
If F = 1 Then Goto Z
Else If F = 2 Then Goto St
Else Goto P
End If
St:
Cls
Lcd "input old code"
Goto S
End
S:
F = Getkbd()
If F > 15 Then Goto S
Else Lcd F
Readeeprom A , 0
If A = F Then Goto S1
Else Goto S3
End If
S1:
F = Getkbd()
If F > 15 Then Goto S1
Else Lcd F
Readeeprom B , 1
If B = F Then Goto S2
Else Goto S4
End If
S2:
F = Getkbd()
If F > 15 Then Goto S2
Else Lcd F
Readeeprom C , 2
If C = F Then Goto S6
Else Goto S5
End If
S3:
F = Getkbd()
If F > 15 Then Goto S3
Else Lcd F
Goto S4
End If
S4:
F = Getkbd()
If F > 15 Then Goto S4
Else Lcd F
Waitms 150
Goto S5
End If
S5:
Lcd "INCORRECT !"
Waitms 150
Goto Ss
End
S6:
Cls
Lcd "INPUT NEW CODE"
Goto S7
End
S7:
F = Getkbd()
If F > 15 Then Goto S7
Else
Cls
Lcd F
Writeeeprom F , 0
Goto S8
End If
S8:
F = Getkbd()
If F > 15 Then Goto S8
Else Lcd F
Writeeeprom F , 1
Goto S9
End If
S9:
F = Getkbd()
If F > 15 Then Goto S9
Else Lcd F
Writeeeprom F , 2
Goto Main
End
Z:
Cls
Lcd : "input code"
Goto Z1
End
Z1:
F = Getkbd()
If F > 15 Then Goto Z1
Else Cls
Lcd F
Readeeprom A , 0
If F = A Then Goto Z2
Else Goto Z5
End If
Z2:
Getkbd()
If F > 15 Then Goto Z2
Else Lcd F
Readeeprom B , 1
If B = F Then Goto Z3
Else Goto Z6
End If
Z3:
Getkbd()
If F > 15 Then Goto Z3
Else Lcd F
Readeeprom C , 2
If C = F Then Goto C
Else Goto Z7
End If
C:
Waitms 100
Lcd "**CORRECT**"
Set Porta.0
End
Z5:
Getkbd()
If F > 15 Then Goto Z5
Else Lcd F
Goto Z6
End If
Z6:
Getkbd()
If F > 15 Then Goto Z6
Else Lcd F
Goto Z7
End If
Z7:
Waitms 150
Cls
Lcd : "INCORRECT"
Waitms 200
Goto Z
End
Config Porta = Output
Dim A As Byte
Dim B As Byte
Dim C As Byte
Dim F As Byte
Main:
Cls
Locate 1 , 1
Lcd "Input code = 1"
Locate 2 , 1
Lcd "Change code = 2"
Goto P
End
P:
F = Getkbd()
If F > 15 Then Goto P
Else
Lcd F
If F = 1 Then Goto Z
Else If F = 2 Then Goto St
Else Goto P
End If
St:
Cls
Lcd "input old code"
Goto S
End
S:
F = Getkbd()
If F > 15 Then Goto S
Else Lcd F
Readeeprom A , 0
If A = F Then Goto S1
Else Goto S3
End If
S1:
F = Getkbd()
If F > 15 Then Goto S1
Else Lcd F
Readeeprom B , 1
If B = F Then Goto S2
Else Goto S4
End If
S2:
F = Getkbd()
If F > 15 Then Goto S2
Else Lcd F
Readeeprom C , 2
If C = F Then Goto S6
Else Goto S5
End If
S3:
F = Getkbd()
If F > 15 Then Goto S3
Else Lcd F
Goto S4
End If
S4:
F = Getkbd()
If F > 15 Then Goto S4
Else Lcd F
Waitms 150
Goto S5
End If
S5:
Lcd "INCORRECT !"
Waitms 150
Goto Ss
End
S6:
Cls
Lcd "INPUT NEW CODE"
Goto S7
End
S7:
F = Getkbd()
If F > 15 Then Goto S7
Else
Cls
Lcd F
Writeeeprom F , 0
Goto S8
End If
S8:
F = Getkbd()
If F > 15 Then Goto S8
Else Lcd F
Writeeeprom F , 1
Goto S9
End If
S9:
F = Getkbd()
If F > 15 Then Goto S9
Else Lcd F
Writeeeprom F , 2
Goto Main
End
Z:
Cls
Lcd : "input code"
Goto Z1
End
Z1:
F = Getkbd()
If F > 15 Then Goto Z1
Else Cls
Lcd F
Readeeprom A , 0
If F = A Then Goto Z2
Else Goto Z5
End If
Z2:
Getkbd()
If F > 15 Then Goto Z2
Else Lcd F
Readeeprom B , 1
If B = F Then Goto Z3
Else Goto Z6
End If
Z3:
Getkbd()
If F > 15 Then Goto Z3
Else Lcd F
Readeeprom C , 2
If C = F Then Goto C
Else Goto Z7
End If
C:
Waitms 100
Lcd "**CORRECT**"
Set Porta.0
End
Z5:
Getkbd()
If F > 15 Then Goto Z5
Else Lcd F
Goto Z6
End If
Z6:
Getkbd()
If F > 15 Then Goto Z6
Else Lcd F
Goto Z7
End If
Z7:
Waitms 150
Cls
Lcd : "INCORRECT"
Waitms 200
Goto Z
End
دیدگاه