Sign in to follow this  
Followers 0
rony2006

Why "10Z" is smaller then "4Z" in autoit???

5 posts in this topic

Hello,

User can input 2 values between 2Z and 14Z in 2 input box.

I need to display this 2 values in a 3rd box BUT the value should be "the biggest number + the smallest number".

So if user inputs 5Z and 10Z, i need to show in 3rd box: 10Z5Z

If user inputs 14Z and 8Z, i need to show in 3rd box: 14Z8Z.

 

I tried the folowing code but is not working ok, is says that 10Z is smaller then 4Z. Why? How can I correct this?

"Z" can be replaced with anything, but it should be someting like a separator

Global $c1 = GUICtrlRead($cartea1) & "Z"  
Global $c2 = GUICtrlRead($cartea2) & "Z"  





If $c1 < $c2 Then
Global $ct = $c2 & $c1
msgbox (0, "dsda", $c1)    %%%%%%%%%% if $c1 = 10 and $c2=2 then i get the msgbox "c1<c2" but this is not true!!
msgbox (0, "dsda", $c2)
msgbox (0, "dsda", "c1<c2")
Endif




If $c1 > $c2 Then
$ct = $c2 & $c1
msgbox (0, "dsda", "c1>c2")
Endif

 

Share this post


Link to post
Share on other sites



because 4Z and 10Z is string.

 

$c1 =  Number($c1)
 $c2 = Number($c2)

 


Regards,
 

Share this post


Link to post
Share on other sites

Thank you

Share this post


Link to post
Share on other sites

You may also first compare the GUICtrlRead(...) which are numeric, then add the Z's where needed

Share this post


Link to post
Share on other sites

yeah you are right, but I resolved using "Number (variable)" 

Thanks!

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  
Followers 0