PDA

View Full Version : IF statement



tony@roadcase.com.au
04-15-2004, 11:24 PM
could somebody please give me an example of a full if ~ then ~ else statement in SB Edit? Slowly banging my head here!
[ eg; if &vari < 150 then 100 else &vari/2 ]
Thanks in anticipation!

Brady Watson
04-16-2004, 08:58 AM
Tony,
The way an IF statement is handled in SB programming is a little different than let's say, BASIC handles it.

You must check one condition at a time in a one-line statement. There is no ELSE or END IF (ENDIF) that I have found in any ShopBot part file.

An example would be something like this:

IF &vari1 < 150 then GOSUB 100
IF &vari1 > 150 then GOSUB 200

****
Unfortunately this is NOT the correct way (which is an extreme bummer)

If &vari1 < 150 then
GOSUB 100
Else
GOSUB 200
EndIf
*****



Or something like that. Be sure to provide the GOSUB number labels for the program to go to (IE the actual line numbers 100 and 200 in the example)

Hope it helps,
Brady

rhfurniture
04-16-2004, 07:30 PM
It is a delightfully simple language. I mean who needs more than one condition at a time?
I am new to shopbot (and most pleased with it) so am sticking to V3 which seems to work just fine.
Only thing is does anyone have an up to date programming manual for V3 - I've already found out the hard way that cutter diameter is on %23 (system variable) rather than %20 as current documentation. How much more am I missing?

Ralph.