- Posts: 3
- Thank you received: 0
Is there a way to tell if a value was passed on the subroutine CALL statement?
3 years 3 months ago #275750
by KenA
Similar to the earlier thread...
In Fanuc you can tell if a parameter was passed on the call line by checking if value = #0 in the subroutine
But it looks like LinuxCNC just passes all the existing #1...#32 variables from the parent routing to the subroutine, for any not specified on the command line.
So as not to break existing macros, is there a way to submit an enhancement request to add a ?global? variable (e.g. <_param_count> that supplies how many parameters were on the command line? I see there are parameters to tell the parent routine if there is a return value (#<_value>, #<_value_returned>)
In Fanuc you can tell if a parameter was passed on the call line by checking if value = #0 in the subroutine
But it looks like LinuxCNC just passes all the existing #1...#32 variables from the parent routing to the subroutine, for any not specified on the command line.
So as not to break existing macros, is there a way to submit an enhancement request to add a ?global? variable (e.g. <_param_count> that supplies how many parameters were on the command line? I see there are parameters to tell the parent routine if there is a return value (#<_value>, #<_value_returned>)
Please Log in to join the conversation.
3 years 3 months ago #276217
by andypugh
Replied by andypugh on topic Is there a way to tell if a value was passed on the subroutine CALL statement?
If enabled in the INI with the option
OWORD_NARGS = 1
Then you can read the parameter #<n_args>
linuxcnc.org/docs/html/config/ini-config...l#gcode:ini-features
I don't know why it defaults to 0. I might change that.
OWORD_NARGS = 1
Then you can read the parameter #<n_args>
linuxcnc.org/docs/html/config/ini-config...l#gcode:ini-features
I don't know why it defaults to 0. I might change that.
Please Log in to join the conversation.
Time to create page: 0.136 seconds
