Roman9 Posted April 28, 2006 Share Posted April 28, 2006 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. Link to comment Share on other sites More sharing options...
jvanegmond Posted April 28, 2006 Share Posted April 28, 2006 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 github.com/jvanegmond Link to comment Share on other sites More sharing options...
Roman9 Posted April 28, 2006 Author Share Posted April 28, 2006 Thanks. I'll look them up now. Link to comment Share on other sites More sharing options...
Paulie Posted April 29, 2006 Share Posted April 29, 2006 (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 April 29, 2006 by Paulie Link to comment Share on other sites More sharing options...
Roman9 Posted April 29, 2006 Author Share Posted April 29, 2006 That's really cool, thanks! Link to comment Share on other sites More sharing options...
herewasplato Posted April 29, 2006 Share Posted April 29, 2006 For $i = 1 To 70 MsgBox($i, $i, $i, 3) NextSeveral ways to do that.... not all numbers will show a MsgBox. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Roman9 Posted April 29, 2006 Author Share Posted April 29, 2006 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. Link to comment Share on other sites More sharing options...
greenmachine Posted April 29, 2006 Share Posted April 29, 2006 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. Link to comment Share on other sites More sharing options...
herewasplato Posted April 29, 2006 Share Posted April 29, 2006 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] Link to comment Share on other sites More sharing options...
Skrip Posted April 29, 2006 Share Posted April 29, 2006 (edited) For $i = 1 To $i + 1 MsgBox($i, $i, $i, 1) NextDon't Run this without a hotkey exit! (or exit with the bottem icon)This would piss me off.... Edited April 29, 2006 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] Link to comment Share on other sites More sharing options...
greenmachine Posted April 29, 2006 Share Posted April 29, 2006 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now