contoh program logika mikrokontroler

Posted by

'--------------------------------------------------------------
'                     (c) 1997-2000 MCS Electronics
'--------------------------------------------------------------
'  file: FOR_NEXT.BAS
'  demo: FOR, NEXT
'--------------------------------------------------------------
Dim A As Byte , B1 As Byte , C As Integer


For A = 1 To 10 Step 2
   Print "This is A " ; A
Next A

Print "Now lets try DOWNTO"
For C = 10 Downto -5
  Print "This is C " ; C
Next



Print "You can also nest FOR..NEXT statements."
For A = 1 To 10
  Print "This is A " ; A
  For B1 = 1 To 10
    Print "This is B1 " ; B1
  Next                                  ' note that you do not have to specify the parameter
Next A



End


Logika Do Loop
'--------------------------------------------------------------
'                     (c) 1997-2000 MCS Electronics
'--------------------------------------------------------------
'  file: DO_LOOP.BAS
'  demo: DO, LOOP
'--------------------------------------------------------------
Dim a As Byte

a = 1                                   'assign a var
Do                                      'begin a do..loop
  Print a                               'print var
  Incr A                                  'increase by one
Loop Until a = 10                       'do until a=10
End

'You can write a never-ending loop with the following code
Do
  'Your code goes here
Loop


Demo Blog NJW V2 Updated at: 11.29

0 komentar:

Posting Komentar