Greater-than, >, is an inequality operator to test whether the value on the left is greater than the value on the right. BASIC also prints it as a prompt to show it is waiting for instruction.
|Availability||Present in all original versions of BBC BASIC.|
|Syntax||BASIC I-V|| <num-var> = <numeric> |
<num-var> = <string>
|Token (hex)||BASIC I-V|| |
|Description||BASIC I-V|| Compares the values of the two operands and returns |
|Associated keywords|| |
> evaluates the expressions on either side, and compares their values. If the value on the left is greater than the one on the right, it returns the Boolean value
TRUE, otherwise it returns
FALSE. It is usually used as the condition of an
IF statement, but it is equally valid to assign the result to a variable.
One numeric variable is greater than another if it is nearer to positive infinity. If both numbers are negative, the one with the smaller magnitude is greater. For the definition of 'greater-than' on strings, please see String collation.
It is not possible to daisy-chain (in)equality tests (for example
IF bool% > X = Y THEN ...), as the Group 5 operators do not associate. Please see
= for more details.
When a greater-than sign appears on the left-hand side of the screen next to the cursor, such as
it means BASIC is waiting for the user to type either:
- a command,
- a *command (beginning with
- a statement,
- a line of a program (a whole number followed by a statement), or
- a VDU sequence (using CTRL)
and press the RETURN key. A program line updates the current program; any other input is processed and executed immediately.
-- beardo 21:19, 6 July 2007 (BST)