question

Marco B5 avatar image
0 Likes"
Marco B5 asked Joerg Vogel edited

How to identify that pointer variable isnt defined/assigned?

I am using a pointer variable as label and I assign this variable dynamically. Now I want to check if I already assigned object/treenode to pointer variable. How can I do that?

Second issue: I would like to reset that variable that no object/treenode is assigned. How can I do that as well?

FlexSim 17.1.5
pointer varibale
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Joerg Vogel edited

If the variable contains a Variant, you can test the length of the label. The word "nullvar" sets the pointer label to be empty.

setting-label-nullvar-v18-0.fsm

setting-label-nullvar-v17-0.fsm

Both files contains the source code in the queue and source triggers to change the label value and print it to the output console. In Flexsim 17.0.12 there isn't the print command available. Then it isn't easy to identify the datatype of a label that is just created. I decided to print the model path to the object in the tree instead.


5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.