SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
String comparison problem

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
String comparison problem
Author Message
Felix



Joined: 16 Aug 2003
Posts: 7

Post String comparison problem Reply with quote

Executing this script:

Dim value, string
Dim ok, boolean

Set value, "1.0"

IsEqual value, "X", ok

Exit

I obtain a "Type mismatch" error on the "IsEqual" statement.
I suppose that this statement "thinks" that "value" is a number because it has a numeric value.
How can I check a string variable that could have a numeric value?

Any ideas?

Tue Sep 09, 2003 10:02 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7963

Post Re: String comparison problem Reply with quote

You are correct, 1.0 is atomatically casted as a number. Because of that you get "Type mismatch" error.

A simple workaround is to prefix strings with some text character before doing the comparision, for example

Concat "a", value, value
IsEqual value, "aX", ok

: Executing this script: Dim value, string
: Dim ok, boolean

: Set value, "1.0"

: IsEqual value, "X", ok

: Exit

: I obtain a "Type mismatch" error on the "IsEqual"
: statement.
: I suppose that this statement "thinks" that "value" is a
: number because it has a numeric value.
: How can I check a string variable that could have a numeric value?

: Any ideas?

Tue Sep 09, 2003 11:08 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.