fluffybunny Report post Posted 03/16/2007 09:21 AM Hi, I am using and Evaluate Module to compare 2 RV's. In my example one is set to 0 and one is set to 1. I am getting an error as shown here: [HOURLY_STOP]{0}[HOURLY_DURATION]{1}[MINS_DURATION]{18}[MAX_DURATION]{1}[OFFID]{ 29}[Valid_Veri_Num_ResultReturn]{success}[Hour_Or_Single1_Input]{Y}[Hour_Or_Sing e1]{Y}[First_Call?_Input]{len(3/15/2007 6:52:40 PM)>2}[First_Call?]{len(3/15/2007 6:52:40 PM)>2}[Already_Stopped?_Input]{len(0)>2}[Already_Stopped?]{False}[update_Or_Stop]{1} 201048.70 1 rv replace end: [$RV(HOURLY_DURATION)<$RV(MAX_DURATION)] 201048.70 1 eval[$RV(HOURLY_DURATION)<$RV(MAX_DURATION)] 201048.70 1 Error: 1032 201048.70 1 rvns add [Exceed_Max_Hrs_Input]{$RV(HOURLY_DURATION)<$RV(MAX_DURATION)} 201048.70 1 rvns add [Exceed_Max_Hrs]{$RV(HOURLY_DURATION)<$RV(MAX_DURATION)} 201048.70 1 Eval Expr result:[$RV(HOURLY_DURATION)<$RV(MAX_DURATION)] 201048.70 1 path {$RV(HOURLY_DURATION)<$RV(MAX_DURATION)} not found 201048.70 1 matching path not found 201048.70 1 next module is [update_Caller_Start] (idx=61) 201048.70 1 matching path was found 201048.70 1 fn RunModule start [say Numbers,[update_Caller_Start],61,,] 201048.70 1 timer clear 201048.70 1 rv replace start: [$RV[Hourly_Duration]] The expression I am trying to evaluate is $RV(HOURLY_DURATION)<$RV(MAX_DURATION) and I have both True and False paths defined. I am using VG version 6.0.3302 Thanks Share this post Link to post
SupportTeam Report post Posted 03/16/2007 09:24 AM Your expression: $RV(HOURLY_DURATION)<$RV(MAX_DURATION) has round brackets "(" instead od square brackets "[" This expression is correct: $RV[HOURLY_DURATION]<$RV[MAX_DURATION] Share this post Link to post
fluffybunny Report post Posted 03/16/2007 09:38 AM Thanks very much. Sorry for bothering you with such a silly error ! Do you have any plans to introduce a syntax checker in VG for the future? Thanks for the super fast response by the way. Share this post Link to post
ktruk Report post Posted 03/16/2007 09:57 AM FluffyBunny: be careful of numeric RV comparisons, as sometimes you may get a 'null' RV being compared with a number, eg: '0 > (null)' which gives an error. Alternatives include doing textual comparisons, putting the RVs in quotes, so that "0" > "" will (probably) work and not give an error or test the RV value in a nested if statement, eg: "If $RV = "" then doThis else doThat". My favorite quick fix is to prefix the $RV with a zero, eg: 0$RV1 > 0$RV2 so that is if the RV is null, you will get 0 > 0, which will pass syntax check. If the RV is not null, then the 'leading zero' is ignored, eg: 0 > 01 = true! Share this post Link to post
fluffybunny Report post Posted 03/16/2007 10:03 AM Hi ktruk, I love your quick fix! I was actually ensuring that I didnt have nulls earlier on in the script, by ensuring the RV is set to something, even if it is 0. But using your method I dont even need to do that. Nice tip, thanks! Share this post Link to post
ktruk Report post Posted 03/17/2007 12:50 PM FluffyBunny: You're welcome! Glad you liked it - and - quick correction - of course 0 > 01 = false !! Share this post Link to post