[OpenSIPS-Users] If statement Syntax issue

osiris123d duane.larson at gmail.com
Sun Dec 6 22:49:58 CET 2009


Ok so I did some more testing and I see the following.  Below in my first
post the $var(current_day) value was 7.  The
$(avp(s:mobile_time){s.substr,8,1}) value was 1 and
$(avp(s:mobile_time){s.substr,9,1}) value was 5.  Well if I changed the
value of $(avp(s:mobile_time){s.substr,9,1}) to be 7 I don't see those
errors and the if statement is true and moves on like it should.  So are
those errors the normal output when an operator is not true?  I would figure
that you would never see those errors if its true or not.



osiris123d wrote:
> 
> I have the following IF statement that looks to be good syntax but I am
> getting an error
> 
> Here is the syntax
> 
> if ( $var(current_day) >= $(avp(s:mobile_time){s.substr,8,1}) &&
> $var(current_day) <= $(avp(s:mobile_time){s.substr,9,1}) )
> {
> blah
> blah
> }
> 
> The error I get is
> CRITICAL:core:comp_scriptvar: cannot get left var value
> WARNING:core:do_action: error in expression (l=650)
> 
> All variables have values so I know thats not an issue and the substr
> Transformation is also correct .  If I edit the IF statement to only have
> the following it works fine
> 
> if ( $var(current_day) >= $(avp(s:mobile_time){s.substr,8,1}) )
> {
> blah
> blah
> }
> 
> Any clues?
> 
> 
> 

-- 
View this message in context: http://n2.nabble.com/If-statement-Syntax-issue-tp4122982p4123091.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.



More information about the Users mailing list