Sign in to follow this  
Followers 0
notprodigy

Get the data from

9 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



Always, always ... GUICtrlRead


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

C:\Program Files (x86)\AutoIt3\random.au3 (29) : ==> Variable must be of type "Object".:

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

MsgBox(0, "Info", "You Picked " & $Combo1^ ERROR

Share this post


Link to post
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.

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

no problem i actualy know how hard it can be as newbe. :-D

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

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

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