Sign in to follow this  
Followers 0
Roman9

Msgbox Types

11 posts in this topic

I'm trying to make a script that goes through all the MsgBox types 1 by one until 70.

So instead of doing:

MsgBox(1, msgbox1, msgbox1)
MsgBox(2, msgbox2, msgbox2)
MsgBox(3, msgbox3, msgbox3)
MsgBox(4, msgbox4, msgbox4)
MsgBox(5, msgbox5, msgbox5)
...
MsgBox(70, msgbox70, msgbox70)

I tried doing:

Global $count1 = 1
Global $title = 1

MsgBox($count1, $title, $count1)

While 1
    If $count1 < 70 Then
        $count1 = $count1 + 1
    Else
        Exit
    EndIf
WEnd

This dosn't go past the first message box and I can't figure out what I am doing wrong.

Thanks for your time.

Share this post


Link to post
Share on other sites



Place the message box in the loop so it posts the message box more then once.

You might also want to look at For loops, which are ideal for these jobs.

Global $count1 = 1
Global $title = 1

While 1
    If $count1 < 70 Then
        $count1 = $count1 + 1
    Else
        Exit
    EndIf
    MsgBox($count1, $title, $count1)
WEnd

Share this post


Link to post
Share on other sites

Thanks. I'll look them up now.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

You might want to make the msgox go at the top of the loop, and so you son't have to click it, do a script like this.

Global $count1 = 1
Global $title = 1


While 1
MsgBox($count1, $title, $count1,3)
    If $count1 < 70 Then
        $title = $title + 1
        $count1 = $count1 + 1
    Else
        Exit
    EndIf
WEnd

This displays each MSGbox for 3 secs the continues so you dont have to click 70 times

Edited by Paulie

Share this post


Link to post
Share on other sites

That's really cool, thanks!

Share this post


Link to post
Share on other sites

For $i = 1 To 70
    MsgBox($i, $i, $i, 3)
Next
Several ways to do that.... not all numbers will show a MsgBox.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Several ways to do that.... not all numbers will show a MsgBox.

I know... this was a test to see which messageboxes do and what they do.

Share this post


Link to post
Share on other sites

I know... this was a test to see which messageboxes do and what they do.

Reading the helpfile under MsgBox would do that too. Then you could try the specific values.

Share this post


Link to post
Share on other sites

I know...

...just going from your 10 lines of code to my suggested 3 lines :-)

I liked your test... some of those I had never bothered to look at before.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

For $i = 1 To $i + 1
    MsgBox($i, $i, $i, 1)
Next

Don't Run this without a hotkey exit! (or exit with the bottem icon)

This would piss me off....

Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites

For $i = 1 To $i + 1
    MsgBox($i, $i, $i, 1)
Next

Don't Run this without a hotkey exit! (or exit with the bottem icon)

This would piss me off....

I see what you were trying to do there, but in case you didn't notice, the upper bound of a For loop doesn't change while the loop is in progress. In other words, this will only show 2 msgboxes and then exit.

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