SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Type Mismatch Error

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Type Mismatch Error
Author Message
pdupuis



Joined: 04 Jan 2007
Posts: 22

Post Type Mismatch Error Reply with quote
Hi,

I don't understand why I have the "Type Mismatch" error while running this script (at line 5):

Dim date_today, String, @T"dd-mm-yyyy"
Dim date_endofmonth, String, @ME"dd-mm-yyyy"
Dim is_same, Boolean

isEqual date_today, date_endofmonth, is_same
if is_same, MODA, MODB
MODA:
MODB:

Please could you help?


Mon Jun 04, 2007 10:21 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7949

Post Reply with quote
The values are all numeric, specified as strings, yet not in entered with quotes, which breaks the parser. The following would do what you want

Code:
Dim date_today, String, "@T"yyyy-mm-dd""
Dim date_endofmonth, String, "@ME"yyyy-mm-dd""
Dim is_same, Boolean

isEqual date_today, date_endofmonth, is_same
if is_same, MODA, MODB
MODA:
MODB:


or alternatively you can use

Code:
Dim diff, number

DateDiff "@T"yyyy-mm-dd"", "@ME"yyyy-mm-dd"", diff
if diff, MODA, MODB
MODA:
MODB:

Mon Jun 04, 2007 10:38 am View user's profile Send private message
LeeD



Joined: 17 May 2007
Posts: 311
Country: New Zealand

Post Reply with quote
Hi, I'm having a similar problem with the following code; the Errorseverity variable is pulled from an INI file using inifilegetkey, and the isequal gives type mismatch whether it is populated or not.

//set the error severity if it's not set
dim nosev, boolean
IsEqual( Errorseverity, "", nosev )
if (nosev, setsev, actionstart)


setsev:
set Errorseverity, "4"

actionstart:
Mon Mar 31, 2008 5:23 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7949

Post Reply with quote
It cannot compare numbers against empty strings as it doesn't know the data type of the empty value

Try this

Code:
dim GotSev, number
length( ErrorSeverity, GotSev )
if (GotSev, actionstart, setsev)

Mon Mar 31, 2008 5:33 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.