Movereal Command
Obsolete
This command is replaced by the Move command.
Purpose
To check data to make sure it is a valid floating point number and move it to a variable.
Syntax
movereal
value
to
variable
What It Does
Movereal checks the value of value to ensure it is a valid floating point number, evaluates it as a floating point number, and moves it to variable.
If the data in value is not a valid floating point number, DataFlex Error 51, 52, or 54 is triggered (depending on the type of error—see below), and the data is not evaluated. Movereal does evaluate expressions.
When a move command addresses an explicit variable of Type Real, the compiler automatically replaces the move command with a movereal command. Where you know that data is being moved to a variable of Type Real, using movereal instead of move can save a very small amount of time per command at compile time.
Notes
- Movereal checks the eligibility of data for the Real type. For example:
- If you movereal a value such as
2(e.g.,2e3), DataFlex Error 51 (Bad format in expression (operand)) will be triggered. - If you movereal an expression such as
2e 3, DataFlex Error 52 (Bad format of expression (operator)) will be triggered. -
If you movereal an expression such as
+2e3, DataFlex Error 54 (Invalid symbol in expression) will be triggered, regardless of the actual type ofvariable. -
Movereal disables DataFlex's automatic type checking of
variables. Therefore, if you movereal to a Date, Integer, Number, or String typevariable, no error will be declared at compile time, nor will one be declared at runtime. This effect is harmless, as long as you intend it.