Jump to content

Get the data from


Recommended Posts

Okay, i seem to be having some trouble with a small bit of code.

basically i just have a small GUI with a combo box, and you pick a number from the combo box and hit the 'go' button. it works, but i dont know how to make it read the value from the combo box

here is the part that is giving me trouble

MsgBox(0, "Beta", "Click 'Okay', And I'll tell you what you put!") 
MsgBox(0, "Info", "You Picked " & $Combo1.????????)
Edited by notprodigy
Link to comment
Share on other sites

use anything like this

FileWriteLine("test.opt", "" & GUICtrlRead($Items))

this piece writes a line with the data in $Items into the file test.opt.

ahhh thank you!

MsgBox(0, "Beta", "Click 'Okay', And I'll tell you what you put!")

MsgBox(0, "Info", "You Picked " & GUICtrlRead($Combo1))

that works perfectly. Hats off to you!

Link to comment
Share on other sites

one more small little question.

how can i divide a number?

like, i have a sleep in miliseconds, and i want to say like

$time = GUICtrlRead($Input3) / 1000

MsgBox (0,"I will sleep for " & $time & " seconds")

doesnt work, although i cant see whats wrong with it.

Help appreciated!

edit, there was no shortcuts here, i had to do this the long way

MsgBox (0,"I will sleep for " & GUICtrlRead($Input3)/1000 & " seconds")

works fine.

Edited by notprodigy
Link to comment
Share on other sites

Are you completely wacky or something?

This:

$time = GUICtrlRead($Input3) / 1000
MsgBox (0,"I will sleep for " & $time & " seconds")

And This:

MsgBox (0,"I will sleep for " & GUICtrlRead($Input3)/1000 & " seconds")

Is exactly the same thing, but neither work! Don't you actually try your code before posting?

Both give "ERROR: MsgBox() [built-in] called with wrong number of args.", but that should be obvious how to fix. Then which one you use is up to you.

Edited by AdmiralAlkex
Link to comment
Share on other sites

Are you completely wacky or something?

This:

$time = GUICtrlRead($Input3) / 1000
MsgBox (0,"I will sleep for " & $time & " seconds")

And This:

MsgBox (0,"I will sleep for " & GUICtrlRead($Input3)/1000 & " seconds")

Is exactly the same thing, but neither work! Don't you actually try your code before posting?

Both give "ERROR: MsgBox() [built-in] called with wrong number of args.", but that should be obvious how to fix. Then which one you use is up to you.

If GUICtrlRead($Input1) < 60000 then
                MsgBox(0, "Info", "Delay is currently set to " & GUICtrlRead($Input1)/1000 & " second(s)")
                else
                    MsgBox(0, "Info", "Delay is currently set to " & GUICtrlRead($Input1)/60000 & " minute(s)")
                    endif

Posted Image

Posted Image

using 10000 for the first one and 300000 for the second.

the error you get is because i wrote that code in like 4 seconds off the top of my head and it is missing the title of the message box

MsgBox (0,"TITLE OF MESSAGE BOX", "I will sleep for " & $time & " seconds")
Edited by notprodigy
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...