SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
quirky OnErrorGoto

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
quirky OnErrorGoto
Author Message
thuan



Joined: 29 Aug 2002
Posts: 22

Post quirky OnErrorGoto Reply with quote

Cut&Pasted below is a script that will demonstrate my problem.

I'm doing a simple file copy. The source file (testOld.txt in this
case), is set up to be a full read/write protected file. This
simulates my situation and raises the Access Denied runtime error.

The script redirects to the RUN_TIME_ERROR label. It fails without the
dummy number declaration, but continues (as wanted) with the dummy
declaration NOT commented out. I've tried other statements instead
of a Dim statement, some continue to the MessageBox, some error out
to the 24x7 dialog message.

Why?

//== START SCRIPT ===============================================
Dim strSourceFile, string "C:\Temp\testOld.txt"
Dim strTargetFile, string "C:\Temp\testNew.txt"
Dim strMessage, string

OnErrorGoto RUN_TIME_ERROR
FileCopy strSourceFile, strTargetFile

RUN_TIME_ERROR:
// Dim i, number
ConcatEx "Got an error!", strMessage
MessageBox strMessage

Exit
//== END SCRIPT ==================================================

Thu Aug 29, 2002 7:18 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Re: quirky OnErrorGoto Reply with quote

Insert Exit after FileCopy line if you do not want to get the error message when there is no error.

By the way, you need to change "C:\Temp\test..." to "C:\\Temp\\test..."

: Cut&Pasted below is a script that will demonstrate my problem.

: I'm doing a simple file copy. The source file (testOld.txt in this
: case), is set up to be a full read/write protected file. This
: simulates my situation and raises the Access Denied runtime error.

: The script redirects to the RUN_TIME_ERROR label. It fails without the
: dummy number declaration, but continues (as wanted) with the dummy
: declaration NOT commented out. I've tried other statements instead
: of a Dim statement, some continue to the MessageBox, some error out
: to the 24x7 dialog message.

: Why?

: //== START SCRIPT ===============================================
: Dim strSourceFile, string "C:\Temp\testOld.txt"
: Dim strTargetFile, string "C:\Temp\testNew.txt"
: Dim strMessage, string

: OnErrorGoto RUN_TIME_ERROR
: FileCopy strSourceFile, strTargetFile

: RUN_TIME_ERROR: // Dim i, number
: ConcatEx "Got an error!", strMessage
: MessageBox strMessage

: Exit
: //== END SCRIPT ==================================================

Thu Aug 29, 2002 8:02 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.