The sample you provided unconditionally clears the variable #PT once the
command flow enters the logic loop.
#PT=1000000 // this resets PT variable to an unknown value
This causes 2 problems. First you will get an error in the WHILE expression
because you cannot compare the value of an undefined (or cleared) variable.
Second, you are unconditionally voiding the user input from the PROMPT
statement.
Try this instead...
//
WHILE(0=0)
IF(#PT=0, OR #PT=1 )// Be sure PT is a 0 or a 1
GOTO(Exit)
ENDIF
PROMPT[TX="Is this a die section with pockets where you have to add a point
for the home move...\n
Enter 0 for NO\n
Enter 1 for YES", VN="PT"]
ENDW
@Exit
//
�
=============================================
Fred Lauzus, CAM Programming Coordinator
High Steel Structures, Incorporated
mailto:[EMAIL PROTECTED] http://www.highsteel.com
=============================================
-----Original Message-----
From: Michael Senack [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 30, 2000 11:37 AM
To: '[EMAIL PROTECTED]'
Subject: [mfg-smartcam] Macro help please
I'm trying to make a mcl that test variable #PT to see if it is a 0 or a 1
using a WHILE, ENDW statement.
Below is what I came up with...doesn't work!
//
WHILE(#PT<0, OR #PT>1 )// Be sure PT is a 0 or a 1
PROMPT[TX="Is this a die section with pockets where you have to add a point
for the home move...\n
Enter 0 for NO\n
Enter 1 for YES", VN="PT"]
#PT=1000000 // this resets PT variable to an unknown value
ENDW
//
What I'm looking for a mcl file to do the following...
1) Ask the user to input a 0 or a 1 for #PT variable
2) Check the user's input. If it is not a 0 or a 1 try again
3) If #PT is a 1 I'll run a P.mcl macro
4) If #PT is a 0 I'll carry on with rest of the .mcl file
Regards,
Michael Senack, X354
Your local friendly neighborhood CNC Programmer
======================================================================
To find out more about this mailing list including how to unsubscribe,
send the message "info mfg-smartcam" to [EMAIL PROTECTED]
======================================================================
======================================================================
To find out more about this mailing list including how to unsubscribe,
send the message "info mfg-smartcam" to [EMAIL PROTECTED]
======================================================================