IN - SOLVE statement will solve a simple arithmetic expression and place the result in a NUMBER variable. Only
* operators, NUMBER values, and TEXT values can be used in a MATH-EXPRESSION. Other LDPL arithmetic functions, like CEIL and MODULO, are not supported by this statement and should be used as standalone statements. TEXT values will be implicitly converted to NUMBERs using the same algorithm as STORE - IN.
Spaces must be used to separate numbers, variables and operators.
As in actual arithmetic,
/ have higher precedence than
- , while parens
() can be used to group expressions.
IN <NUMBER-VAR> SOLVE <MATH-EXPRESSION>
IN myNumVariable SOLVE 1 + 1
Will set the value of
Area of Circle:
DATA:Radius is NUMBERArea is NUMBERPROCEDURE:DISPLAY "Enter Radius: "ACCEPT RadiusIN Area SOLVE 3.14159 * (Radius * Radius)DISPLAY "Area is: " Area CRLF
Enter Radius: 0.5Area is: 0.7853975