IBM 5100 Basic Reference Manual page 83

Hide thumbs Also See for 5100:
Table of Contents

Advertisement

(
(
(
Notes About IF
• The expressions being compared within the relational expressions must contain
data of the same type (character or arithmetic).
• THEN and GOTO are interchangeable in the I F statement. Either can be used,
but not both. GOTO is stored by the system.
• Comparison for equal must compare exactly to 13 digits.
Example
The following examples show a variety of IF statements:
30 IF A(3)
=1=
X+2/Z GOTO 85
40 IF R$
=
'CAT' GOTO 70
50 IF S2
=
37.222 GOTO 120
60 IF X>Y GOTO 90
70 IF A>BI C>O GOTO 110
80 IF A$
=
'JOB' & B$
=
'OATE' GOTO 100
In statement 40, for example, if character variable R$ contains the word CAT, pro·
gram control is passed to statement 70. In statement 70, if either A> B or C> 0,
control passes to statement 110.
79

Advertisement

Table of Contents
loading

Table of Contents