The problem I'm working on requires to reassign multiple dynamic references.
I have 20 dynamic references. Let's call them DYN_REF_1, DYN_REF_2..., DYN_REF_20. Additionally, I also have 5 string parameters LOT_NO_1, LOT_NO_2,..., LOT_NO_5.
When the process starts, first 5 dynamic references are assigned to corresponding string parameter, so we have:
'^/DYN_REF_1.$REF':="/LOT_NO_1";
'^/DYN_REF_2.$REF':="/LOT_NO_2";
...
'^/DYN_REF_5.$REF':="/LOT_NO_5";
When certain process conditions are met, I need to shift dynamic references by process parameter PARAM_VAL. Let's assume PARAM_VAL=3 So the result would be:
'^/DYN_REF_4.$REF':="/LOT_NO_1";
'^/DYN_REF_5.$REF':="/LOT_NO_2";
'^/DYN_REF_8.$REF':="/LOT_NO_5";
Pseudo code would be like below:
'^/DYN_REF_"+(1+'^/PARAM_VAL.CV')".$REF':="/LOT_NO_1";
'^/DYN_REF_"+(2+'^/PARAM_VAL.CV')".$REF':="/LOT_NO_2";
'^/DYN_REF_"+(5+'^/PARAM_VAL.CV')".$REF':="/LOT_NO_5";
(The reason why I modify dynamic reference instead of the string reference is that I need to use them on graphic display. I need to be able to show same string (LOT_NO_X) in different places of a graphic display. I used only 5 string parameters in this example to make this clear, in reality there are many more string parameters, so I can't use other features like hide/show animation effectively. Even if there are better ways to do so, I would like to explore this option first.)
Of course, such syntax is not correct. How can I solve multiple dynamic references dynamically, depending on a variable that determines which dynamic reference I should use?
In reply to Pieter Degier:
Thank you Pieter for your answer. Your hint sounds quite good and it works. The only problem is that I use couple of graphics to show these values. First one ends with, let's say, LOT_NO_20 and seconds one starts with LOT_NO_21 etc. Shifting position in this case would be probably still possible but a little bit tricky. Cedric, to make my problem easier to understand, I would ask a question : If I have 20 dynamic references, DYN_REF_1...20, is there any other way than multiple IF/THEN/ELSE statements to determine first empty Dynamic reference?
Once this is done, I would have to shift dynamic references by process parameter PARAM_VAL like in my first post.
Maybe some VBA scripting would help?
In reply to ThomasZiel: