Skyrimfus

If >= not working properly

4 posts in this topic

 

$Ra_force_pos[$i-1] = 5
$RLENGHT = 10
 


If $RA_Force_pos[$i-1] >= $RLENGHT Then
MsgBox(0,"",$RA_Force_pos[$i-1]&" "&$RLENGHT)
Else

GUICtrlSetData($Output,"S:"&$RA_Force_pos[$i-1]&" J"&$RA_Force[$i-1]&@CRLF,1)

Endif

I don't see why instead of GUICtrlSetData function being executed, i get the message box saying "5 10"

If i change $Ra_force_pos[$i-1] to 20 I still get the message "20 10"

 

Share this post


Link to post
Share on other sites



This is the whole script?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2016-12-04 - Version 1.2.2.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
Just now, water said:

This is the whole script?

Nope, was fiddling around and i think I found the solution

I was  trying to figure it out for 1 hour and gave up, posted it here and a solution that works came to my mind

$Ra_force_pos[$i-1] = 5
$RLENGHT = 10
 


If Number($RA_Force_pos[$i-1]) >= Number($RLENGHT) Then
MsgBox(0,"",$RA_Force_pos[$i-1]&" "&$RLENGHT)
Else

GUICtrlSetData($Output,"S:"&$RA_Force_pos[$i-1]&" J"&$RA_Force[$i-1]&@CRLF,1)

Endif

Notice how I added the If NUMBER(...) >= NUMBER(...)

Share this post


Link to post
Share on other sites

Seems you changed the datatype of either one or both variables somewhere in your script.
Insert

MsgBox(0, "", VarGettype($RA_Force_pos[$i-1]) & "-" & VarGettype($RLENGHT))

before your If-Statement and see what you get.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2016-12-04 - Version 1.2.2.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now