- Posts: 1004
- Thank you received: 449
How to make M1** execute Gcode
- my1987toyota
- Offline
- Platinum Member
-
Less
More
4 years 3 months ago #248761
by my1987toyota
Replied by my1987toyota on topic How to make M1** execute Gcode
I have another question for you andy . Why are only "if" statemants used and not "if" and "elif".?
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
-
Less
More
- Posts: 19899
- Thank you received: 4655
4 years 3 months ago - 4 years 3 months ago #248765
by andypugh
But the file names in that folder need to be unique.
Replied by andypugh on topic How to make M1** execute Gcode
It's not entirely inexplicable, all these files live in an attachments folder on the server, and mine is almost certainly not the first remap.py posted here.for some inexplicable reason the forum will include the date in some file names.
But the file names in that folder need to be unique.
Last edit: 4 years 3 months ago by andypugh.
The following user(s) said Thank You: my1987toyota
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
-
Less
More
- Posts: 19899
- Thank you received: 4655
4 years 3 months ago #248766
by andypugh
Do you want the real answer? I jump between C, VBA and Python so often I forget which uses elif, else if and elseif.
Replied by andypugh on topic How to make M1** execute Gcode
I have another question for you andy . Why are only "if" statemants used and not "if" and "elif".?
Do you want the real answer? I jump between C, VBA and Python so often I forget which uses elif, else if and elseif.
The following user(s) said Thank You: my1987toyota
Please Log in or Create an account to join the conversation.
- my1987toyota
- Offline
- Platinum Member
-
Less
More
- Posts: 1004
- Thank you received: 449
4 years 3 months ago #248792
by my1987toyota
Replied by my1987toyota on topic How to make M1** execute Gcode
Gotcha I didn't know if their was some specific rule of why you used only if statements. it was only when I looked up how to do Case Statements
in python that I discovered that python doesn't do Case statements like C or C++ and probably others do. I am trying to learn C on my own
But honestly I'm struggling with it right now.
in python that I discovered that python doesn't do Case statements like C or C++ and probably others do. I am trying to learn C on my own
But honestly I'm struggling with it right now.
Please Log in or Create an account to join the conversation.
- my1987toyota
- Offline
- Platinum Member
-
Less
More
- Posts: 1004
- Thank you received: 449
4 years 2 months ago #248835
by my1987toyota
Replied by my1987toyota on topic How to make M1** execute Gcode
Hi Andypugh . I have a Python question for you. From what I have read if you exclusively use "if" statements multiple one's can be true and
executed at the same time. if someone uses "if" and "elif" statements once one is true the rest are ignored. Am I understanding that correctly?
I am still very much learning this stuff so I don't know the rules yet.
executed at the same time. if someone uses "if" and "elif" statements once one is true the rest are ignored. Am I understanding that correctly?
I am still very much learning this stuff so I don't know the rules yet.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
Less
More
- Posts: 4793
- Thank you received: 1480
4 years 2 months ago #248843
by Todd Zuercher
Replied by Todd Zuercher on topic How to make M1** execute Gcode
An if and the elif statemts that follow it form a tree or line, that once one of the statements in that line are true, the ones that follow (in that line) are ignored. But that doesn't apply to other separate if lines in the program. They should still be processed individually. Elif (or else if) is kind of the opposite of then.
The following user(s) said Thank You: my1987toyota
Please Log in or Create an account to join the conversation.
Time to create page: 0.179 seconds