SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Casting variables

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Casting variables
Author Message
Robbert de GROOT



Joined: 13 Dec 2000
Posts: 53

Post Casting variables Reply with quote

Good morning

I've again a problem with the automatic
casting of variables within a 24x7 script :

Left (buffer, 1, wrk)
IsEqual wrk, ":", success
If (success, NOUVELLE_TABLE, WRITE_INFO)

As long as wrk contains a non numeric character there seem to be no problem (wrk has been dimensioned as a string) but as soon as wrk contains a numeric value, the following statement (IsEqual …) “hangs” the script.

Two questions :
Why is the 24x7 script processor doing automatic casting
How can this correctly be avoided ?

Thanks for helping
Robbert

Mon Jul 04, 2005 6:32 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7975

Post Re: Casting variables Reply with quote

It is doing automatic casting for backward compatibility reasons, that's the way it was defined in versions 1.x and 2.x

In this particular case you can change your script to the following (in order to avoid any ambiguities)

Concat "a", wrk, wrk
IsEqual wrk, "a:", success

As you can see no matter what you get in the buffer, the value of wrk is always non numeric.

: Good morning

: I've again a problem with the automatic
: casting of variables within a 24x7 script : Left (buffer, 1, wrk)
: IsEqual wrk, ":", success
: If (success, NOUVELLE_TABLE, WRITE_INFO)

: As long as wrk contains a non numeric character there seem to be no problem
: (wrk has been dimensioned as a string) but as soon as wrk contains a
: numeric value, the following statement (IsEqual …) “hangs” the script.

: Two questions : Why is the 24x7 script processor doing automatic casting
: How can this correctly be avoided ?

: Thanks for helping
: Robbert

Mon Jul 04, 2005 11:39 am View user's profile Send private message
Robbert de GROOT



Joined: 13 Dec 2000
Posts: 53

Post Re: Casting variables Reply with quote

Thanks for your hint. I'll work on it in that way.
But autocasting means that chzecking the content of
a variable is always a very risky. I do not like to auto-cast
as it will give quite some problems. Checking the length of
a file name for exemple. If the name of the file is 123445
and doing a LEN on it .... hung your script.

When will auto-cast disappear ??

Robbert

: It is doing automatic casting for backward compatibility reasons, that's the
: way it was defined in versions 1.x and 2.x

: In this particular case you can change your script to the following (in order
: to avoid any ambiguities)

: Concat "a", wrk, wrk
: IsEqual wrk, "a:", success

: As you can see no matter what you get in the buffer, the value of wrk is
: always non numeric.

Mon Jul 04, 2005 12:06 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7975

Post Re: Casting variables Reply with quote

I don't think this will change any time soon in JAL. There already exist some alternatives to JAL like internal VBScript language support and also usage of external scripting languages. Support for additional scripting languages alternatives will be greatly expanded in future versions. JAL top-level methods will be probably exposed in these languages as built-in language extensions.

: Thanks for your hint. I'll work on it in that way.
: But autocasting means that chzecking the content of
: a variable is always a very risky. I do not like to auto-cast
: as it will give quite some problems. Checking the length of
: a file name for exemple. If the name of the file is 123445
: and doing a LEN on it .... hung your script.

: When will auto-cast disappear ??

: Robbert

Mon Jul 04, 2005 2:08 pm View user's profile Send private message
Robbert de GROOT



Joined: 13 Dec 2000
Posts: 53

Post Re: Casting variables Reply with quote

Thanks anyway for the help and explanation

: I don't think this will change any time soon in JAL. There already exist some
: alternatives to JAL like internal VBScript language support and also usage
: of external scripting languages. Support for additional scripting
: languages alternatives will be greatly expanded in future versions. JAL
: top-level methods will be probably exposed in these languages as built-in
: language extensions.

Mon Jul 04, 2005 4:58 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.