Jump to content
Skyrimfus

If >= not working properly

Recommended Posts

Skyrimfus

 

$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
water

This is the whole script?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Skyrimfus
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
water

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 (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
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

×