Macro - validation of arguments
Posted: Tue Jan 17, 2023 8:46 pm
Is there a way to test macro arguments to see if they are present?
In Haas if I call "G65 P100 A1 B2" I can check in the macro if the argument is or is not present by testing it against #0 (which is not-a-number)
O100 (macro)
(test for argument 1)
if [#1 NE #0] GOTO1
#3000 = 1 (argument #1 is not valid)
N1
argument #1 is valid
(test for argument 2)
if [#2 NE #0] GOTO1
#3000 = 1 (argument #2 is not valid)
N1
argument #1 is valid
If I call "G65 P100 B2" the first argument test will fail because it doesn't exist.
In Haas if I call "G65 P100 A1 B2" I can check in the macro if the argument is or is not present by testing it against #0 (which is not-a-number)
O100 (macro)
(test for argument 1)
if [#1 NE #0] GOTO1
#3000 = 1 (argument #1 is not valid)
N1
argument #1 is valid
(test for argument 2)
if [#2 NE #0] GOTO1
#3000 = 1 (argument #2 is not valid)
N1
argument #1 is valid
If I call "G65 P100 B2" the first argument test will fail because it doesn't exist.