Moveint Command
Obsolete
This command is replaced by the Move command.
Purpose
To check data to make sure it is a valid Integer, and move it to a variable.
Syntax
moveint
value
to
variable
What It Does
moveint checks the value of value to ensure it is a valid Integer, evaluates it as an integer, and moves it to variable.
If the data in value is not a valid Integer, DataFlex Error 51, 52, or 54 is triggered (depending on the type of error—see below), and the data is not evaluated. moveint does evaluate expressions.
When a move command addresses an explicit variable of Type Integer, the compiler automatically replaces the move command with a moveint command. Where you know that data is being moved to a destination of Type Integer, using moveint instead of move can save a very small amount of time per command at compile time.
Notes
moveintchecks the eligibility of data for the integer type. For example:- If you
moveinta value such as2*2, DataFlex Error 51 (Bad format in expression (operand)) will be triggered. - If you
moveintan expression such as2 2, DataFlex Error 52 (Bad format of expression (operator)) will be triggered. -
If you
moveintan expression such as+2, DataFlex Error 54 (Invalid symbol in expression) will be triggered, regardless of the actual type ofvariable. -
moveintdisables DataFlex's automatic type checking ofvariables. Therefore, if youmoveintto a Date, Number, Real, or String type destination, 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. -
If you wish to strip fractional (decimal) components from the value of any variable of Type Number, you can use:
moveint variable to variable
where variable is the same Number type variable.