Jump to content

newbi problem


Recommended Posts

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

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...