Page 1 of 1

Loop While or GoTo to Freeze Script Until

PostPosted: Wed Jan 26, 2011 3:02 pm
by SpiritualMadMan
John,

I must be blind, or something?

During my script I need to prompt the user to do something, so I "System" out to a Prompt...

I need to "freeze" the Script until the user responds to the prompt by closing the window.

I had though I could loop while propmt is active or keep checking for Active and Goto and check again until it's killed.

But, I can't seem to find the functionality.

Got any ideas?

Thanks!

Re: Loop While or GoTo to Freeze Script Until

PostPosted: Wed Jan 26, 2011 4:17 pm
by john
Are you running an external application for the prompt? You mentioned you are using 'System', so I assume you are. If you are, you can use 'Run' instead of 'System'. This will wait until the application finishes before continuing:

Code: Select all
System("c:\windows\system32\cmd.exe");  # Runs the command prompt and continues immediately
Run("c:\windows\system32\cmd.exe"); # Runs the command prompt and waits for it to close before continuing


If you just want input, you could also use the built-in InputString, InputInt, or InputReal:

Code: Select all
1 >>string s = InputString("Enter a string: ");  # Prompts 'Enter a string'
Enter a string: hello
2 >>disp(s);
hello


I hope this helps, please let me know if you have any questions!

-John

Re: Loop While or GoTo to Freeze Script Until

PostPosted: Wed Jan 26, 2011 5:03 pm
by SpiritualMadMan
Thanks!

I'll try the Run Command.

I have a Prompt.exe that I created as part of another program that allows me to send a Prompt String to it and it will format it in Font and Size specified...

Gives a nice large legible, hard to miss Message Box... :)