If...then Branching - Agilent Technologies 3458A User Manual

Hide thumbs Also See for 3458A:
Table of Contents

Advertisement

130 END

IF...THEN Branching

The IF...THEN command provides conditional branching within 3458A
subprograms. The syntax statements for the IF...THEN command is shown
below.
IF expression THEN
program segment
[ ELSE ]
[ program segment ]
ENDIF
The ENDIF statement must follow the IF...THEN statement somewhere in
the subprogram. ELSE is an optional statement, but if used must appear
before the ENDIF statement. All commands after the IF...THEN statement
and before the ELSE and ENDIF statements will be executed if the
expression evaluates to true (not equal to zero).
If the expression is true, execution continues with the program segment
between IF...THEN and ELSE. If the expression is false, execution continues
with the segment after ELSE. In either case, when the program segment is
completed, assuming there are no other loops or conditional branches,
program execution continues with the statement following the ENDIF
statement.
10 OUTPUT 722; "SUB DMM_CONF"
20 OUTPUT 722; "INTEGER I"
30 OUTPUT 722; "LET I=1"
40 OUTPUT 722; "NRDGS 100"
50 OUTPUT 722; "TRIG SGL"
60 OUTPUT 722; "IF I<100 THEN"
70 OUTPUT 722; " ENTER A[I] "
80 OUTPUT 722; " LET l=l+1"
90 OUTPUT 722; "ENDIF"
100 OUTPUT 722; "SUBEND"
110 !
120 OUTPUT 722; "CALL DMM_CONF"
130 END
280
Chapter 7 BASIC Language for the 3458A

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents