Jump to content
Sign in to follow this  
Lee Evans

ControlGetText and number comparison

Recommended Posts

Lee Evans

Hi I am stuck. I am using ControlGetText to define a variable and then discover which of two values is the smallest and then use this as the maximum value parameter for a randomnly generated number.

DIM $wpfalen=0, $wpfawid=0

$wpfalen=ControlGetText("Pattern", "", "Static30")
$wpfawid=ControlGetText("Pattern", "", "Static32")

MsgBox(0, "What has been read from statics", "1st-"&$wpfalen&"-"&$wpfawid&"-")
If $wpfalen >= $wpfawid then
    $wpmax = $wpfawid
    MsgBox(0, "What is $wpmax", "1st route-"&$wpmax&"-" )
    $wpmax = $wpfalen
    MsgBox(0, "What is $wpmax", "2nd route-"&$wpmax&"-" )

But the problem I am having is that occasionally the >= statement is being evaluated incorrectly.

Do I need to convert the text from the statics to a number? If so how?


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

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.