Jump to content

Recommended Posts

Posted

$time = inputbox ("hi", "how long are you going to be gone?")
msgbox (1, "bye", "you will be gone for $time")
If msgbox = 1;continue on with script
If msgbox = 0;go to top of script
;i want to make it conditional so if they want to change the amount of $time they
;can

And how can i get it to state a $time inside the MsgBox text....Do you know what i mean....i know i cant put it in the " ", but is there some way the msgbox can have 2 lines (without spacing it down) and what would i enter into the coding to make that work. i know AI2 would just use \ to make a new line in a msgbox right?

im sorry if this is too confusing but i need to clean up my scripts...they run like a 20 year old FORD.

Posted

wouldn't he also need to have a variable defined by the msgbox to get it's results?

like so:

$continue = msgbox(...

if $continue = 1 then

"I'm not even supposed to be here today!" -Dante (Hicks)

  • Developers
Posted

wouldn't he also need to have a variable defined by the msgbox to get it's results?

like so:

$continue = msgbox(...

if $continue = 1 then

you only need to do that when you want to know what button is clicked or if it timed out.....

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.
  :)

Posted

you only need to do that when you want to know what button is clicked or if it timed out.....

so after i make that, how do i determine where to send the user....back to the inputbox to reenter the correct variable ( if they hit CANCEL). and how do i make it continue if they hit OK?
Posted

msgbox (1, "bye", "you will be gone for $time")
If msgbox = 1;continue on with script
If msgbox = 0;go to top of script
that seems to be what they're aiming at doing with this part...

"I'm not even supposed to be here today!" -Dante (Hicks)

Posted

though I'd do a

while $continue = 0

;msgbox

wend

"I'm not even supposed to be here today!" -Dante (Hicks)

  • Developers
Posted

so after i make that, how do i determine where to send the user....back to the inputbox to reenter the correct variable ( if they hit CANCEL). and how do i make it continue if they hit OK?

something like

$rc =msgbox (1, "bye", "you will be gone for "& $time)

and then test $rc.... these are the value listed in the Helpfile:

Success: Returns the ID of the button pressed.

Failure: Returns -1 if the message box timed out.

Button Pressed Return Value

OK 1

CANCEL 2

ABORT 3

RETRY 4

IGNORE 5

YES 6

NO 7

TRY AGAIN ** 10

CONTINUE ** 11

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.
  :)

Posted

I think now is when we point to the help file and in specific suggest looking at while...wend if...then...else and msgbox perhaps also the operators and variables sections...

"I'm not even supposed to be here today!" -Dante (Hicks)

Posted

i live out of the HELP FILES. but does it just return if the msgbox value is 1 (cancel) and continue to the Then if msgbox = 0?

what im really trying to say is what number or string reroutes to where?

say they hit cancel, what does this do

IF $msgbox = 1

;what do i put here to make it go to the top for them to reenter values?

Then

IF $msgbox = 0

;then what happens here?

Then

  • Developers
Posted

just a simple example that will keep on looping till cancel is clicked...

While 1
   $rc =msgbox (1, "title", "text "& $time)
   if $rc = 2 Then Exit
  ; do what you want to do for OK
Wend

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.
  :)

Posted

One more example, if you want confirmation:

While 1
$answer = InputBox("Question", "Where were you born?", "Planet Earth", "")
$test=MsgBox(4,"Question","You were born on " & $answer & "?")
If $test=6 Then ExitLoop
Wend
MsgBox(1,"Your final answer was",$answer)

AutoIt3, the MACGYVER Pocket Knife for computers.

  • 4 weeks later...
Posted

is there some way the msgbox can have 2 lines (without spacing it down) and what would i enter into the coding to make that work.  i know AI2 would just use \ to make a new line in a msgbox right?

I could neither find anything about it in the helpfile under 'messagebox' nor while searching the forum with 'messagebox' ...
  • Developers
Posted

I could neither find anything about it in the helpfile under 'messagebox' nor while searching the forum with 'messagebox' ...

do you mean something like this?

MsgBox(0,"test","Line 1" & @LF & "Line 2")

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.
  :)

Posted

I could neither find anything about it in the helpfile under 'messagebox' nor while searching the forum with 'messagebox' ...

He's right I think Ihad to ask how to get a return on a msgobx

$ret=msgbox(1,"Msgbox sample","Click OK or CANCEL")

;Adding your msgbox number with 4096 will make it stay on top

;4096 + 1 = msgbox(4097,Msgbox sample","Click OK or CANCEL")

msgbox(1,"Msgbox sample","Click OK or CANCEL" &@CRLF&"The return value is "&$ret)

;Now you can do your if then's based on the return value

;Rick

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
  • Recently Browsing   0 members

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