SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Line Number Variable

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Line Number Variable
Author Message
Michael Tuszynski



Joined: 07 May 2004
Posts: 30

Post Line Number Variable Reply with quote

Is there a builtin variable for grabbing the line number in a JAL script where an error occured?
What happens in the example below is that the script lists the error occured at the last line of the script every time there is an error.

Any suggestions?

-Mike

This is how I am handling errors in my scripts:

Dim message, string
OnErrorGoto ERROREND

...code here...

(sample error)
Ifthen(doesFileExist, COPYFILE)

RaiseError("Error occured here")
COPYFILE:
...code continues..

ERROREND:

GetLastError(message)

Dim subj, string

ConCatEx("@V"job_name"", " error. See message and log for details.", subj)

MailSend

OnErrorStop

RaiseError(message)


Thu Oct 07, 2004 6:36 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: Line Number Variable Reply with quote

Sorry, there is no such variable. It would be nice to have one.

What you can do is to set your own variable and increment it as needed (perhaps increment by one in every logical step of your script) then in the RaiseError place you can have the following

Concat( "Step #", my_step_var, " - ", message, message )
RaiseError ( message )

: Is there a builtin variable for grabbing the line number in a JAL script
: where an error occured?
: What happens in the example below is that the script lists the error occured
: at the last line of the script every time there is an error.

: Any suggestions?

: -Mike

: This is how I am handling errors in my scripts: Dim message, string
: OnErrorGoto ERROREND

: ...code here...

: (sample error)
: Ifthen(doesFileExist, COPYFILE)

: RaiseError("Error occured here")
: COPYFILE: ...code continues..

: ERROREND: GetLastError(message)

: Dim subj, string

: ConCatEx("@V"job_name"", " error. See message and
: log for details.", subj)

: MailSend

: OnErrorStop

: RaiseError(message)

Thu Oct 07, 2004 8:57 am 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.