Loop While or GoTo to Freeze Script Until

General discussion about the Phantom Automation Language and related tools.

Loop While or GoTo to Freeze Script Until

Postby SpiritualMadMan on Wed Jan 26, 2011 3:02 pm

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!
SpiritualMadMan
 
Posts: 20
Joined: Mon Dec 06, 2010 4:02 pm

Re: Loop While or GoTo to Freeze Script Until

Postby john on Wed Jan 26, 2011 4:17 pm

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
john
 
Posts: 27
Joined: Wed Apr 22, 2009 12:32 pm

Re: Loop While or GoTo to Freeze Script Until

Postby SpiritualMadMan on Wed Jan 26, 2011 5:03 pm

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... :)
SpiritualMadMan
 
Posts: 20
Joined: Mon Dec 06, 2010 4:02 pm


Return to Phantom

Who is online

Users browsing this forum: No registered users and 9 guests

cron