Sign in to follow this  
Followers 0
laffo16

newbi problem

5 posts in this topic

dim $cash, $leavetablechips

$cash = InputBox("Question", "Enter table with (X) cash", 10, "", 240, 124)
if @error = 1 Then
    Exit
EndIf

$leavetablechips = InputBox("Question", "Leave table if chips are less then (X)", 7, "", 240, 124)
if @error = 1 Then
    Exit
EndIf

if $leavetablechips > $cash Then
    MsgBox(0, "error - exit launch", "chips brought to table are less then leave table chip count.")
    MsgBox(0, "", "if " & $leavetablechips & " > " & $cash & " then exit")
    Exit
EndIf

i dont understand why i'm getting the msgbox pop up error when i run this. If 7 > 10 then msgsbox & exit. for some reason i dont understand i'm getting the msgbox & exit.

however when if i use this code:

dim $cash, $leavetablechips

$cash = 10
$leavetablechips = 7

if $leavetablechips > $cash Then
    MsgBox(0, "error - exit launch", "chips brought to table are less then leave table chip count.")
    MsgBox(0, "", "if " & $leavetablechips & " > " & $cash & " then exit")
    Exit
EndIf

it works fine. where am i going wrong? thank you

Share this post


Link to post
Share on other sites



Side note... WTF is a "newbi"? Multiple Newbies?


My UDFs: ExitCodes

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

dim $cash, $leavetablechips

$cash = 10
$leavetablechips = 7

if $leavetablechips > $cash Then
    MsgBox(0, "error - exit launch", "chips brought to table are less then leave table chip count.")
    MsgBox(0, "", "if " & $leavetablechips & " > " & $cash & " then exit")
    Exit
EndIf

it works fine. where am i going wrong? thank you

YOu are doing an Alphanumeric test which compares characters ...not values:

dim $cash, $leavetablechips

$cash = "10"
$leavetablechips = "7"

if $leavetablechips > $cash Then
    MsgBox(0, "error - exit launch", "chips brought to table are less then leave table chip count.")
    MsgBox(0, "", "if " & $leavetablechips & " > " & $cash & " then exit")
    Exit
EndIf

Use Number() to convert the typed characters to a real value

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Side note... WTF is a "newbi"? Multiple Newbies?

hahah.. "newbi"..

*cough* anyways..

Just like Jdeb said, but i took to long to reply :lmao:

Global $cash, $leavetablechips

$cash = Int(InputBox("Question", "Enter table with (X) cash", 10))
if @error = 1 Then
    Exit
EndIf

$leavetablechips = Int(InputBox("Question", "Leave table if chips are less then (X)", 7))
if @error = 1 Then
    Exit
EndIf

if $leavetablechips > $cash Then
    MsgBox(0, "error - exit launch", "chips brought to table are less then leave table chip count.")
    MsgBox(0, "", "if " & $leavetablechips & " > " & $cash & " then exit")
    Exit
EndIf
Edited by CHRIS95219

Share this post


Link to post
Share on other sites

thank u

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