If statement confusion

More
14 Nov 2022 03:40 #256652 by masterjuggler
I've been reading about o codes and parameters so I can edit or make macros, and I've been struggling to figure out what the following subroutine from my toolchange macro is doing: 
o<010> if [1 EQ 1]
  ...some code
o<010> endif
It looks like it's always going to be true because of course 1 is equal to 1. There's no # to indicate a parameter. What am I missing?

Please Log in or Create an account to join the conversation.

More
14 Nov 2022 05:25 #256664 by cmorley
Replied by cmorley on topic If statement confusion
You are absolutely right, it will always run.
It's probably just left over from a code change that never got removed.
The following user(s) said Thank You: masterjuggler

Please Log in or Create an account to join the conversation.

More
14 Nov 2022 10:12 #256672 by andypugh
Replied by andypugh on topic If statement confusion
This is a way to turn on or off a block of code. You would edit the file to be "If 1 = 0" to disable that block.

I am actually a bit more puzzled by the O<010> structure, apparently using the named-block syntax with a numerical value. It works, I suppose, but looks strange.
The following user(s) said Thank You: masterjuggler

Please Log in or Create an account to join the conversation.

More
14 Nov 2022 12:46 #256681 by masterjuggler
Oh, well that's anticlimactic lol. Thanks for clarifying.

I'm not really sure why that subroutine is numbered 010, it's from the probe basic set of macros and subroutines. Must have made sense to them at the time.

Please Log in or Create an account to join the conversation.

Time to create page: 0.066 seconds
Powered by Kunena Forum