use the function ChkFile to see if the destination file exists.
----- Original Message -----
From: <[email protected]>
To: "RBASE-L Mailing List" <[email protected]>
Sent: Monday, June 22, 2009 8:52 AM
Subject: [RBASE-L] - Error Variable
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
--- RBASE-L
================================================
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [email protected]
(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: INTRO
================================================
TO UNSUBSCRIBE:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: UNSUBSCRIBE
================================================
TO SEARCH ARCHIVES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body,
place any
text to search for.
================================================