Sharp OZ-707 Operation Manual - Page 79
special, attention
![]() |
UPC - 074000012141
View all Sharp OZ-707 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 79 highlights
IF ...THEN ... ELSE p FORMA T: lline nUmberj l'ine numberj IF condition THEN :Klabel [ELSE :Klabel ] statement statement Abbreviation: IF T. EL. See Also: AND, OR, NOT, XOR PURPOSE: Conditionally executes a statement at the time the program is run. REMARKS: When the condition of the IF statement is true, the statement following THEN is executed; if it is false, the statement following ELSE is executed. When the ELSE statement is omitted and the condition is false, the statement following THEN is skipped. If THEN or ELSE is followed by a GOTO statement, either THEN or GOTO may be omitted (ELSE statement must be included). Example 1: IF A= x x No less than 00 < xx Less than 00 5):K(B>1) THEN .... If A is greater than 5 and B is greater than 1, the statement following THEN is executed. Logical operator "AND" may be used in place of ":K". IF (A>5)+(8>1) THEN .... If A is greater than 5 or B is greater than 1, the statement following THEN is executed. Logical operator "OR" may be used in place of "+". Using Character Strings in Relational Expressions The magnitudes of character strings can be compared when used in a relational expression of an IF...THEN ...ELSE statement. The magnitudes of character codes are compared. For example, characters A, B, and C have codes 65,66, and 67, respectively. So A is smaller than B, and B is smaller than C. EXAMPLE: 10: INPUT"CONTINUE?";A$ 20: IF A$="YES" THEN 10 30: IF A$="NO" GOTO 60 40: PRINT "YES OR NO, PLEASE" 50: GOTO 10 60: Note : Whenever a variable name is to be followed by a statement, be sure to insert a space between them, for example: 100 IF A=EL.,THEN 200 t..... A space is needed. Pay special attention to this when you use the IF, FOR, ON...GOTO, or ON...GOSUB command. 147
![](/manual_guide/products/sharp-oz707-operation-manual-7aa0508/79.png)