BYVAL Operator

InstallShield 2020 ยป InstallScript Language Reference

They keyword BYVAL can be specified in the parameter specification of a function prototype to indicate a parameter that is passed by value rather than by reference, as in the example below:

    prototype DisplayString( BYVAL STRING );

When a parameter is passed by value, the function receives a copy of the value and any changes it makes to that value are local to the function.

By default, the parameters of a user-defined function are passed by value; so generally it is not necessary to specify this keyword in a function protytpe. (There is one exception: by default, string variables passed to DLL functions are passed by reference, so the value of the variable can be changed by the function.)

When you want a user-defined function to operate directly on a variable it receives in a parameter rather than on a copy of that variable, you must specify the BYREF operator.

See Also