Simple Statements
A simple statement is a statement that doesn't contain any other statements. Each line of code in your program can contain only one simple statement. The end of line denotes the end of the statement.
Assignment Statements
Assignment statements are used to change the value of a variable. The syntax of an assignment statement is:
Move {expression} To {Variable}
Some examples of assignment statements are:
Move ("Harry") To sName
Move (iX + iY) To iTotal
Move (iX > 100) To bFinished
Move (tan(.70711)) To nTangent
Move (sName) To Customer.Name
If the {expression} part of the assignment statement is a single constant or a variable, then you may omit the parentheses (). For example, the first and last assignment statements in the previous example could be re-written as:
Move "Harry" To sName
Move sName To Customer.Name
Note: DataFlex supports additional specialized assignment commands (Increment, Decrement, Add, Subtract). Refer to the DataFlex Language Reference for more information about these commands.
Continuing a Statement on the Next Line
The end of the line character generally marks the end of the simple statement; however, long statements can be continued on the following line by placing a semicolon (;) character at the end of the first line.
You can continue a statement in this way over several contiguous lines until the maximum line length limitation is reached. Examples of a simple statement continued over more than one line are:
Function TagName string sDrive string sDir string sExt ;
returns string
If (sTagname="") ;
Get TagName "c:" sDfltDir sDfltExt to sTagName
Else ;
Move "" to sTagName
Move ("This is quite a long message " +
"so I will break it up over " +
"three lines!") To sMessage
Notes
You cannot break any single token over two lines (e.g., in the above example, the message could not have been expressed as a single string and broken over several lines). Instead, it was written as three strings that are appended together by the append string operator (+).