Dim A As Integer
A = 10
If A = 10 Then 'test expression
Print "This part is executed." 'this will be printed
Else
Print "This will never be executed." 'this not
End If
If A = 10 Then Print "New in BASCOM"
If A = 10 Then Goto Label1 Else print "A<>10"
Label1:
Rem The following example shows enhanced use of IF THEN
If A.15 = 1 Then 'test for bit
Print "BIT 15 IS SET"
EndIf
Rem the following example shows the 1 line use of IF THEN [ELSE]
If A.15 = 0 Then Print "BIT 15 is cleared" Else Print "BIT 15 is set"
Dim I As Byte 'dim variable
Dim S As String * 5 , Z As String * 5
Do
Input "Enter value (0-255) " , I
Select Case I
Case 1 : Print "1"
Case 2 : Print "2"
Case 3 To 5 : Print "3-5"
Case Is >= 10 : Print ">= 10"
Case Else : Print "Not in Case statement"
End Select
Loop
End
'note that a Boolean expression like > 3 must be preceded
'by the IS keyword
overlocker писал(а):Посоветуйте какиенить датчики, пусть и сложеные, которые позволят работать роботу не зависимо от неровнестей и засветки солнцем.
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 35