Do…While Statement (FPScript)
Executes a series of statements until a given condition is FALSE.
Syntax
Do
[Statements]
While Condition
The syntax of the Do...While statement consists of the following elements:
Element |
Description |
---|---|
Condition |
An expression that results in TRUE, FALSE or any numeric scalar value. For the numerical result, all values not equal to zero are taken to be TRUE. |
Statements |
One or more statements between Do and While that are repeated as long as Condition results in true. |
Remarks
The statements in the Do...While block are executed first. Next, the Condition is checked annd the statements are repeated when Condition has the value TRUE. If Condition has the value FALSE, then the program continues the execution with the statement following Condition.
Do...While statements can be nested as you like. A While statement always refers to the last executed Do statement at the same level.
Available in
FlexPro View, Basic, Professional, Developer Suite
Example
The following example searches in a signal for local maxima that occur after a slope and returns this as a signal:
Arguments Data
Dim Pos, ResultPos
Pos = Data.X[0n]
Do
Pos = NextSlope(Data, Pos, 0.2, 0.2, 0.1, EVENT_POSITIVE)
If Pos <> Empty Then
Pos = NextExtremum(Data, Pos, 0.1, EVENT_POSITIVE)
ResultPos := Pos
End
While Pos <> Empty
Data[[ResultPos]] // Data set with points found
See Also
For Each Value...End Statement
For Each Element...End Statement