Return Statement (FPScript)
Ends the calculation of a formula and passes the value of the specified expression as a result.
Syntax
Return [Result]
The syntax of the Return statement consists of the following elements:
Element |
Description |
---|---|
Result |
An optional expression whose value is to be used as the result of the formula. If you omit the expression, the formula returns the Empty value as the result. |
Remarks
The result of the last statement in the formula is automatically returned as the result. In this case, you do not have to use a Return statement.
Note: If you specified a unit in the formula's header information, then the result of the formula is transformed to this unit before it is passed.
Available in
FlexPro View, Basic, Professional, Developer Suite
Example
The following example determines the time interval between two local maxima in a signal and returns ? if not enough maxima were found:
Arguments Signal
Dim Idx
Idx = Extrema(Signal, 0.1, EVENT_POSITIVE)
If NumberOfRows(Idx) < 2 Then
Return ?
End
Signal.x[Idx[1n]] - Signal.x[Idx[0n]]