Sign in to follow this  
Followers 0
Midget182

More Help Plz

18 posts in this topic

$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.

Share this post


Link to post
Share on other sites



don't put your variables inside the string but concatenate them like:

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


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

awesome, thanks

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

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

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

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?

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

though I'd do a

while $continue = 0

;msgbox

wend


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

Share this post


Link to post
Share on other sites

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


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

#10 ·  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)

Share this post


Link to post
Share on other sites

#11 ·  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

Share this post


Link to post
Share on other sites

#12 ·  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

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

#13 ·  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.

Share this post


Link to post
Share on other sites

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' ...

Share this post


Link to post
Share on other sites

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")

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

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


Only $2.00 with Resale Rights How to Block Better for Martial Artists and NonMartial Artistshttp://kirkhamsebooks.com/MartialArts/Bloc...tterEbook_m.htm

Share this post


Link to post
Share on other sites

Perfect. Thank You!

(Maybe I was just to blind to find it somewhere.)

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