Parameters Property (AProgram) |
Version 6, modified 8 |
Returns or sets the program parameter as specified by the sName parameter.
[ vValue = ] Object.Parameters ( [sName] )
Object.Parameters ( sName ) [ = vValue ]
The Parameters property syntax has the following parts:
Name |
Type |
Description |
Object |
AProgram |
AProgram object |
sName |
[Val] BString |
Optional. The parameter name which specifies the program parameter. If the parameter is omitted or empty the function return all the parameters names and values. |
vValue |
Variant |
The value of the program parameter specified by sName. The value can be either a number or a string. |
The parameters name and type are defined in the Program properties window. Their value can be initially set in the Program Shortcut properties window and then change at run time using this property. Parameters can be used to configure the program, set values so they can be used by the program at run-time.
The following example first sets the parameter named "AdapterName" for the current program, then it prints in the log the parameter and loop on all parameters to print their names and value:
Program.Parameters("AdapterName")="XYZ"
print Program.Parameters("AdapterName") ! will print: XYZ
vParameters=Program.Parameters() ! store all parameters and names to a variant
for i=0 to VarDimSize(vParameters, 0)-1
print "Parameter Name="; vParameters[i][0]; ", Value="; vParameters[i][1]
next