&Pgm = 'rPtOrder';
Call(&Pgm, &V1);
Restrictions when using this naming method:
PC/LAN: When the application generated by Clipper is going to be compiled, you must include all objects that are going to be compiled (the program names) and are being called.
The programs which are called via variable names will not be included in the executable when compiling an application generated by Clipper. Therefore, a list of User Modules (Compile Option) must also be included.
iSeries: String constants (literals) cannot be passed as parameters. The program name must be written in upper case letters.
Visual Basic: variable call is not allowed in Visual Basic, because all Calls must resolve when compiling and building the executable file. There is a workaround to solve this problem, you can define a "dummy" event in the object where you want to perform the variable call and in this event perform the call to the corresponding object depending on the condition.
For example:
Event Dummy
If cond=value1
Call('Pgm1', parm1, ,parmN)
Else
If cond=value2
Call('Pgm1', parm1, ,parmN)
Else
…
...
Endif
Endevent