04-05-2010 03:13 AM
Is it possible to create StationGlobal, FileGlobal and Locals from a C# code module?
I know it is possible to get and set variables using PropertyObject, but as far as I know it is not possible to create them.
Best regards
04-05-2010 09:37 AM
The easiest way is to use the PropOption_InsertIfMissing option with the SetVal* methods.
Be careful if you have multiple threads accessing the variables at the same time though because if you are creating and deleting variables dynamically while accessing/creating/deleting them from other threads it can lead to race conditions (i.e. crashes and memory corruption). If you need to access the variables from multiple threads at once, I'd recommend creating all the variables upfront, if possible, in the first thread, before any other threads try to access them, otherwise you will need to use a Lock step or step setting to protect access to the variables and any parents variables of variables you are inserting or deleting.
Hope this helps,
-Doug
04-10-2010 12:30 PM