Intermec PB51 Fingerprint Developer's Guide (old) - Page 33
Using an IF...THEN...[ELSE]...END IF Instruction, About Branching, Branching to Subroutines
View all Intermec PB51 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 33 highlights
Chapter 2 - Understanding Fingerprint Syntax 60 END RUN Another way to compare the two values in the example above is to use three IF...THEN statements: 10 INPUT "Enter first value ", A% 20 INPUT "Enter second value ", B% 30 C$="First value > second value" 40 D$="First value < second value" 50 E$="First value = second value" 60 IF A%>B% THEN PRINT C$ 70 IF A%120000 THEN 40 PRINT "TIME IS ";TIME$("F"); ". "; 50 PRINT "GO TO LUNCH!" 60 ELSE 70 PRINT "CARRY ON - "; 80 PRINT "THERE'S MORE WORK TO DO!" 90 END IF RUN This results in (for example): TIME IS 12:15. GO TO LUNCH! About Branching Both conditional and unconditional branching is possible in Fingerprint. • For information on conditional branching, see the next section. • For information on unconditional branching, see "Unconditional Branching Using a GOTO Statement" on page 21. • For information on branching to subroutines, see the next section. Branching to Subroutines A subroutine is a range of program lines intended to perform a specific task separately from the main program execution. For example, branching to subroutines can occur when: • an error condition occurs. • a condition is fulfilled, such as a certain key being pressed or a variable obtaining a certain value. • a break instruction is received. Intermec Fingerprint Developer's Guide 17