Hi everyone,
I discovered labtalk macros a while ago, and wanted to use one macro including arguments. As always I wanted to make sure there is an error when no arguments are provided, so the users knows how to use the macro.
The only way I found is rather ugly:
def ArgumentTest {
string Argument1="%" + "1";
string Argument2="%" + "2";
if ("%1" != Argument1$ && "%2" != Argument2$) {
type "Two Arguments %1 and %2";
}
else {
type "Some error message";
}
}
If no argument is provided, %1 is used as literal text %1.
Invoking with no or just one argument triggers the error message:
ArgumentTest Test
Is there a smoother way? How to prevent %1 from being substituted before running the commands?
Origin Ver. and Service Release (Select Help-->About Origin): 8.6.0G SR3
Operating System: WinXP SP3