You issued SET ERROR VARIABLE ON before defining the error variable, so since there wasn't one, ON became the error variable. Clear the varname you ordinarily use for ERROR (mines' vERR), then set it:

SET ERROR VARIABLE vERR

After there is a placeholder for the ERROR VARIABLE, then you can execute the ON/OFF with impunity.
FWIW, don't try to assign a value in the same line as the declaration, like:

SET ERROR VARIABLE vERR = 0
or
SET ERROR VARIABLE vERR = null

Set its starting state after the declaration, like:

SET ERROR VARIABLE vERR
set var vERR = Null or set var vERR = 0




----- Original Message ----- From: <[email protected]>
To: "RBASE-L Mailing List" <[email protected]>
Sent: Monday, June 22, 2009 5:06 PM
Subject: [RBASE-L] - Re: Error Variable




I just noticed this and although it probably is unrelated to my issue, I am unsure what the correct

syntax is. The help file on SET ERROR VARIABLE states:



Syntax: SET ERROR VARIABLE varname
SET ERROR VARIABLE ON/OFF

And that one should use the SET ERROR VARIABLE OFF instead of Clear Var



" You must always set ERROR VARIABLE off, rather than clearing it with the CLEAR VARIABLES command. "



However when I issue :



R>sho var
Variable = Value Type
------------------ ------------------------------ -------- #DATE = 06/22/2009 DATE
#TIME = 4:01 PM TIME
#PI = 3.14159265358979 DOUBLE
SQLCODE = 0 INTEGER
SQLSTATE = 00000 TEXT
#NOW = 06/22/2009 4:01 PM DATETIME

R>set error variable on

R>sho var
Variable = Value Type
------------------ ------------------------------ -------- #DATE = 06/22/2009 DATE
#TIME = 4:02 PM TIME
#PI = 3.14159265358979 DOUBLE
SQLCODE = 0 INTEGER
SQLSTATE = 00000 TEXT
#NOW = 06/22/2009 4:02 PM DATETIME
on = 0 INTEGER


I see a variable named "ON" created. I do not think this is the intent of the

SET ERROR VARIABLE ON statement, so I must be doing something incorrect.

I tried single quotes etc. but got the same result.



SET ERROR VARIABLE OFF does not create a variable named OFF however.



Anyone have any insight on this as to what I am doing wrong with this?



Thanks,

-Bob



----- Original Message ----- From: [email protected]
To: "RBASE-L Mailing List" <[email protected]>
Sent: Monday, June 22, 2009 8:20:09 AM GMT -06:00 US/Canada Central
Subject: [RBASE-L] - Re: Error Variable

Hi Bob! ASAIK, the error variable always returns an integer. I've never seen it return a word. Maybe you're using the variable vError somewhere else in your system and it's a text, and not being cleared? Try initializing: set var vError INT = NULL before you set your error variable....

Karen




I must not be understanding the error variable function, so hopefully someone can help out.



In an app, I am copying files to a different folder. I have the following setup to check for errors.

Set Error Variable ON

SET ERROR VAR vError

....

(many lines of code)

.....

SET VAR vedifile = 'G:\RBTI\Edi_V8\*.850'
SET VAR vcopyto = 'G:\RBTI\Edi_V8\Archive\*.850'
COPY .vedifile .vcopyto

IF verror <>0 THEN
CLS
PAUSE 1 USING 'Error Archiving File! Contact IT Department' +
CAPTION 'House of Fara EDI System' ICON stop

ELSE
PROPERTY MessageText caption 'File(s) archived!'
ERASE .vedifile
ENDIF
.....more code


The HELP files state :

" R:BASE resets the error variable to zero as each command is successfully run"



The issue seems to be that vError does not always return the same value

if the operation succeeds. I have traced the app and also displayed the value for

vError while running the app and sometimes it returns the word "OK" and

other times it returns the number "0" (ZERO) if the file copy succeeds.

Therefore my "IF vError <>0 Then" does not always work.



Is the ERROR Variable function not be applicable to the file COPY command?



What other methods are being used to verify a copy command has succeeded?



Thanks in advance for any education on the error variable function.



(version v8)



-Bob








R:BASE resets the error variable to zero as each command is successfully run"



The issue seems to be that vError does not always return the same value

if the operation succeeds. I have traced the app and also displayed the value for

vError while running the app and sometimes it returns the word "OK" and

other times it returns the number "0" (ZERO) if the file copy succeeds.

Therefore my "IF vError <>0 Then" does not always work.



Is the ERROR Variable function not be applicable to the file COPY command?



What other methods are being used to verify a copy command has succeeded?



Thanks in advance for any education on the error variable function.



(version v8)



-Bob










I must not be understanding the error variable function, so hopefully someone can help out.



In an app, I am copying files to a different folder. I have the following setup to check for errors.

Set Error Variable ON

SET ERROR VAR vError

....

(many lines of code)

.....

SET VAR vedifile = 'G:\RBTI\Edi_V8\*.850'
SET VAR vcopyto = 'G:\RBTI\Edi_V8\Archive\*.850'
COPY .vedifile .vcopyto

IF verror <>0 THEN
CLS
PAUSE 1 USING 'Error Archiving File! Contact IT Department' +
CAPTION 'House of Fara EDI System' ICON stop

ELSE
PROPERTY MessageText caption 'File(s) archived!'
ERASE .vedifile
ENDIF
.....more code


The HELP files state :

" R:BASE resets the error variable to zero as each command is successfully run"



The issue seems to be that vError does not always return the same value

if the operation succeeds. I have traced the app and also displayed the value for

vError while running the app and sometimes it returns the word "OK" and

other times it returns the number "0" (ZERO) if the file copy succeeds.

Therefore my "IF vError <>0 Then" does not always work.



Is the ERROR Variable function not be applicable to the file COPY command?



What other methods are being used to verify a copy command has succeeded?



Thanks in advance for any education on the error variable function.



(version v8)



-Bob


Reply via email to