Mike,
Your syntax is correct and should work. It does work outside of the WHILE
loop. This appears to be a bug in the WHILE loop function. It seems that you
can use IF statements within the WHILE loop, but cannot use the modifiers
AND & OR within the IF statement when contained in the loop. You can however
nest the IF statements within the WHILE loop as an alternative.
// Production_Milling 11.5 Windows 10/16/98 16:52:40 Macro File
// w:\mcl\jsf.mcl
// CREATED: 01/03/01
//
//
VAR_REMOVE_ALL[]
// set counter for 1st step in list
#Counter=1
//
// loop through step list
WHILE(#Counter<=OPNLIST(0))
// extract step number from step in list
#Step=OPNLIST(#Counter)
// open step
JOS_CONTEXT_OPEN[BASEITEM=1, USERNAME=#Step]
// check for invalid tool length AND invalid side angle for a face mill
IF(jos(tl_len)=32000)
IF(jos(sideang)=32000)
// assign tool length of 1 inch
JOS_FIELD_EDIT[FLDNAME="tl_len", EXPR="1"]
// assign side angle of face mill to 0
JOS_FIELD_EDIT[FLDNAME="sideang", EXPR="0"]
// assign cutter raduis to 0
JOS_FIELD_EDIT[FLDNAME="cradius", EXPR="0"]
// apply changes made to step
JOS_CHANGES_PROMOTE[]
ENDIF
ENDIF
// close step
JOS_CONTEXT_CLOSE[]
// advance counter to next step in list
#Counter=#Counter+1
ENDW
�
=============================================
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: Wednesday, January 03, 2001 8:34 AM
To: '[EMAIL PROTECTED]'
Subject: [mfg-smartcam] IF help
I'm trying to build in some logic testing using an IF test in the WHILE/ENDW
loop.
However, the IF keeps bombing.
If I test tl_len=32000 by itself it works and
if I test sideang=32000 by itself it works.
When I test the IF using an ,AND for both tl_len and sideang equal to 32000
is doesn't work!
Hmmm,,,
// Production_Milling 11.5 Windows 10/16/98 16:52:40 Macro File
// w:\mcl\jsf.mcl
// CREATED: 01/03/01
//
//
VAR_REMOVE_ALL[]
// set counter for 1st step in list
#Counter=1
//
// loop through step list
WHILE(#Counter<=OPNLIST(0))
// extract step number from step in list
#Step=OPNLIST(#Counter)
// open step
JOS_CONTEXT_OPEN[BASEITEM=1, USERNAME=#Step]
// check for invalid tool length AND invalid side angle for a face
mill
IF(jos(tl_len)=32000 ,AND jos(sideang)=32000)
// assign tool length of 1 inch
JOS_FIELD_EDIT[FLDNAME="tl_len", EXPR="1"]
// assign side angle of face mill to 0
JOS_FIELD_EDIT[FLDNAME="sideang", EXPR="0"]
// assign cutter raduis to 0
JOS_FIELD_EDIT[FLDNAME="cradius", EXPR="0"]
// apply changes made to step
JOS_CHANGES_PROMOTE[]
ENDIF
// close step
JOS_CONTEXT_CLOSE[]
// advance counter to next step in list
#Counter=#Counter+1
ENDW
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]
======================================================================