Wave dependency in user-defined functions
euaruksakul
Function Dependency_test1()
make /O/N=5 wave1
wave1={1,2,3,4,5}
make /O /N=5 wave2
wave2:=wave1
End
make /O/N=5 wave1
wave1={1,2,3,4,5}
make /O /N=5 wave2
wave2:=wave1
End
but always get an error "Can't use local variables in dependency formula" during compile.
This seems to work in the command line. I am not sure what I am doing wrong?
Thank you!
make /O/N=5 wave1
wave1={1,2,3,4,5}
make /O /N=5 wave2
SetFormula wave2, "wave1"
End
When I use
Edit root:wave1,root:wave2
I can change values in wave1 and those in wave2 change automagically.Hope this helps,
Kurt
July 7, 2017 at 02:41 am - Permalink
July 7, 2017 at 03:11 am - Permalink
// stupid example to make this point...
String wname = "liberal name for my wave"
make /O/N=5 $wname
WAVE wave1 = $wname
wave1={1,2,3,4,5}
// now create the dependency
make /O /N=5 wave2
String wave1name = GetWavesDataFolder(wave1, 2)
SetFormula wave2, wave1name
End
If you now run this function, then go to Misc->Object Status you will see that wave2 depends on wave1 via this formula: "root:'liberal name for my wave'". Note the data folder path, and special quoting for the liberal name.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
July 7, 2017 at 09:56 am - Permalink