The dictionaryfromvariables( function builds a new dictionary and initializes it from a list of variables (carriage return delimited).
This function has one parameter:
The dictionaryfromvariables( function creates a new collection of values (dictionary) and initializes it with the contents of one or more variables. The variables to be included are specified by a carriage return delimited list.
This example creates a new dictionary collection containing all of the local variables that currently exist in the current procedure.
When combined with the setlocalsfromdictionary statement, this function can be used to quickly transfer multiple variables from one procedure to another.
The first line of the mySubroutine procedure can use the setlocalsfromdictionary statement to turn the values back into variables.
setlocalsfromdictionary parameter(1) // mySubroutine now has all the same variables that the calling procedure had
Important Note: Keep in mind that the mySubroutine procedure now has a copy of the variables in the oalling procedure, not the original variables. If you have programmed using other languages, these variables have been passed by value, not by reference. So if you modify any of these variables, the modified value will not be passed back to the original procedure when the subroutine is finished. The original procedure will still have it’s original, unmodified variables. Of course you could pass the new values back the same way.
|10.2||New||New in this version.|