Hi Staff
I wanted to start using JMP classes in scripting, but ran into an unfortunate behaviour: When giving arguments to a method, the arguments are treated as if they were class members, which makes classes almost unusable as the argument to the method depends on if a class member already uses that variable. I found no way to force sending a global or here: variable to the method. I believe it to be a bug. The following code reproduces this behaviour:
define class ("aClass",
varA = .;
aMethod=method({someVar},
varA = someVar;
show(someVar);
)
);
obj=new object(aClass());
varB=3;
obj:aMethod(varB);
varA=4;
obj:aMethod(varA);
obj:aMethod(::varA);
In the above, because varA is both a global variable and a metod variable, "aMethod" just gets 3 and not 4 in the argument. So behaviour is influenced by interaction between internal class member names and global variable names.
Kind regards,
Thomas