I built a WDPro project in which I am using functions, very simple ones, for a macro like the following:
- Code: Select all
if vtog = me1dev2
{
VValue,vtog,me1dev1
}
else
{
VValue,vtog,me1dev2
}
Which basically toggles the variable vtog between two other variables.
Now let's make a function out of it so it can be re-used with multiple variables
- Code: Select all
togglelayer{switch,device1,device2}
if switch = device2
{
VValue,switch,device1
}
else
{
VValue,switch,device2
}
to call back that function and inject values in it I will then write
- Code: Select all
togglelayer{vtog,me1dev1,me1dev2}
Sometimes it works, sometimes it doesn't and I have no clue why. Yesterday the very same WDPro project, works. Today, it doesn't. Then again yesterday I was building the project so maybe there is something that needs to be done for functions to work and I did it while programming, maybe my code is badly written, I'm lost .
Thanks for the help