 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
Loril
Joined: 21 Feb 2007 Posts: 82
|
|
Strange 'Bug' When Parsing Job IDs |
|
Hi,
I am trying to parse a string of 24x7 scheduler job ids and output certain job properties to a text file. The script runs fine until it hits the last two job ids. For some reason, 24x7 scheduler will generate the type mismatch error when the job id variable contains only number. This type mismatch error, I am assuming, occurs because the scheduler sees the value in the variable as a number versus a string. How can I get around this? Thanks.
Here's an excerpt of the script:
LoopUntil( no_more, END_LOOP )
// get next job ID
GetToken(",", job_list, job_id )
isEqual( job_list, "", no_more ) <====This is where the error occurs when the variable job_list only contains one job_id.
|
|
Mon Aug 13, 2007 10:30 pm |
|
 |
Loril
Joined: 21 Feb 2007 Posts: 82
|
|
|
|
bump....any updates on this? Thanks!
|
|
Tue Aug 21, 2007 8:23 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7949
|
|
|
|
Sorry for delays with response. We got affected by widespread Internet outage, which started yesterday and caused by some telecom repairs in US. Our systems were not working and alerts and emails didn't function properly.
----
The issue you are encountering is causing by automatic data type conversion feature. In your case, numeric strings are automatically converted to numbers. When trying to compare a number against empty string a data-type mismatch occurs. If you want you can search the forum for "mismatch" and you will find a number of topics discussing this issue. In brief, the simplest solution in your case is to append some "end marker" value to the end of the list.
Concat( no_more, "*done*", no _more)
…
isEqual( job_list, "*done*", no_more )
PS. job_id should be declared as a string.
|
|
Wed Aug 22, 2007 9:55 am |
|
 |
|
|
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
|
|
|