Jim,
That is how I would use the ERROR VARIABLE for test purposes.
I however define it at startup of the application and remove it only at 
application shutdown.

I am curious in the insert code shown you use '-0-' as an insert value. Is this 
intended to represent a NULL value? If so a better programming practice would 
be to use the key word NULL j.i.c. you ever change the display format for null.

 Jim Bentley
American Celiac Society
[email protected]
tel: 1-504-737-3293




________________________________
From: Jim Belisle <[email protected]>
To: RBASE-L Mailing List <[email protected]>
Sent: Sat, March 6, 2010 9:40:35 AM
Subject: [RBASE-L] - error variable

  
I have never used the SET ERROR VAR code before and would
like to verify I understand the explanation in the Help.
 
I run a command file that updates our inventory and compares
it to our open orders.
When the inventory is less than what is needed to fill the
orders, the command shows what we need to fill the difference.
 
However if there are no negatives (enough inventory to meet
orders) I get the error when I create the view because there are no rows to be
found.
 
I added the below code to the command to “capture”
the error and send  it to the end of the command file.
 
Am I using the variable correctly?
 
Jim
 
-- Process negative sub assys that are part of major assys.
-- Added check for error message to care for no negatives.
Lines 165,169-172
SET ERROR VAR verrvar
DELETE ROWS FROM tNewopen
INSERT INTO tNewopen SELECT Partnum,pcsgood,'-0-' FROM
tInvallopen +
   WHERE pcsgood < 0 ORDER BY partnum
IF verrvar <> 0 THEN
   CLS
   GOTO Openinvup
ENDIF
 
(Rest of code here if there are negatives.)
 
LABEL Openinvup
DELETE ROWS FROM INV_ALL_OPEN
INSERT INTO INV_ALL_OPEN SELECT
newdate,partnum,openpcs,invpcs,madepcs,outpcs +
   FROM tInvallopen order by partnum
SET ERROR VAR OFF


      

Reply via email to