Getting Operator Inputs

From Shopbot Wiki

(Difference between revisions)
Line 55: Line 55:
[[Image:BY_A&B.jpg]]
[[Image:BY_A&B.jpg]]
-
(NOTE:) Be careful when using the INPUT statement this way to make sure that you think about what would happen if the operator typed in a incorrect value or something that the file didn't expect. If the next line in the file above cut a part file in offset mode, an incorrect value typed in (like "C") would cut the file from the current location, which might not be what you want.
+
(NOTE:) Be careful when using the INPUT statement this way to make sure that you think about what would happen
 +
if the operator typed in a incorrect value or something that the file didn't expect. If the next line in the file
 +
above cut a part file in offset mode, an incorrect value typed in (like "C") would cut the file from the current
 +
location, which might not be what you want.
=== The MSGBOX command ===
=== The MSGBOX command ===

Revision as of 22:19, 18 January 2008

Contents

Getting Input from the Tool operator

There are several ways to get communicate with the tool operator, and to get and use answers from them.



The PAUSE command

A PAUSE command, without a time value after it or a comment before it, will display a "Continue" box like this.


Image:BY_JustPause.jpg


If the PAUSE command follows a comment, that comment will appear in a message box. The only options the operator has, though, is OK to continue or CANCEL to end the file. If you had these lines in your file:

'Start cutting now?
PAUSE

Then this box would appear on the screen:


Image:BY_CommentPause.jpg


The INPUT command

The INPUT command is much more useful and versatile, and let's the operator not on give answers to questions, but give the file numeric answers as well. An input statement like this

INPUT "How thick is your material?" &thickness

Would present the tool operator with this box, and whatever number they typed would be saved in the &thickness variable.


Image:BY_thicknessInput.jpg


You can also have the operator make decisions by giving them codes to type in, like this:

INPUT "Type (Y) to zero the Z-axis here." &ZeroAnswer


Image:BY_ZeroInput.jpg


and test for multiple inputs like this, like this:

INPUT "Type (A) to move to 0,0 or (B) to move to 12,12." &MoveAnswer
IF &MoveAnswer = A THEN M2,0,0
IF &MoveAnswer = B THEN M2,12,12

Image:BY_A&B.jpg

(NOTE:) Be careful when using the INPUT statement this way to make sure that you think about what would happen
if the operator typed in a incorrect value or something that the file didn't expect. If the next line in the file
above cut a part file in offset mode, an incorrect value typed in (like  "C") would cut the file from the current
location, which might not be what you want.


The MSGBOX command


Contributors
BillYoung, Gaston, Don
Personal tools