Programmer Guide > Programming with PV-WAVE > Using Program Control Routines
  

Using Program Control Routines
The program control procedures are largely self-explanatory, with the exception of the EXECUTE function. The EXIT procedure exits the PV-WAVE session. STOP terminates execution of a program or batch file, and prints the values of its optional parameters. WAIT, as its name implies, pauses execution for a given amount of time, specified in seconds.
Executing One or More Statements
The EXECUTE function compiles and executes one or more PV-WAVE statements contained in its string parameter during run-time.
The result of the EXECUTE function is true (1), if the string was successfully compiled and executed. If an error occurred during either phase the result is false (0). If an error occurs, an error message is printed.
Use the & character to separate multiple statements in the string. GOTO statements and labels are not allowed.
Example of Executing Multiple Statements in a Command
This example, taken from the Standard Library routine SVDFIT, calls a function whose name is passed to SVDFIT as a string in a keyword parameter. If the keyword parameter is omitted, the function POLY is called:
; Function declaration.
FUNCTION SVDFIT, ..., Funct = Funct
...
; Use default name, POLY, for function if not specified.
IF N_ELEMENTS(Funct) EQ 0 THEN Funct = 'POLY'
; Make a string of the form "a = funct(x,m)", and execute it.
z = EXECUTE('a = ' + Funct + '(x, m)')
...

Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.