If statement confusion
- masterjuggler
 - Offline
 - New Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 12
 - Thank you received: 6
 
			
	
						14 Nov 2022 03:40				#256652
		by masterjuggler
	
	
		
			
	
			
			 		
													
	
				If statement confusion was created 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: 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?			
					o<010> if [1 EQ 1]
  ...some code
o<010> endifPlease Log in or Create an account to join the conversation.
- cmorley
 - Offline
 - Moderator
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 7230
 - Thank you received: 2106
 
			
	
						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.
					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.
- andypugh
 - 
				
											 - Offline
 - Moderator
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 19678
 - Thank you received: 4559
 
			
	
						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.
					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.
- masterjuggler
 - Offline
 - New Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 12
 - Thank you received: 6
 
			
	
						14 Nov 2022 12:46				#256681
		by masterjuggler
	
	
		
			
	
			
			 		
													
	
				Replied by masterjuggler on topic If statement confusion			
			
				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.
					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.089 seconds