START-APP or postfix StartApp strange behavior?

nnCron and nnCron LITE discussion

START-APP or postfix StartApp strange behavior?

Postby LuckMan212 » Thu, 07 Jul 2005, 02:22

Hello, greetings

I have the following tasks (example)

Code: Select all
#( test1
NoActive
\ this task works as expected

: user_click
   0 S" mmc.exe %systemroot%\system32\eventvwr.msc" StartApp DROP
;
Action:
   2 BalloonIcon !
   ['] user_click OnBalloonClick !
   BALLOON: "Attention!" "Click me to launch Event Viewer!"
)#


#( test2
NoActive
\ this task will do nothing when balloon is clicked

: user_click
   0 S" eventvwr.msc" StartApp DROP
;
Action:
   2 BalloonIcon !
   ['] user_click OnBalloonClick !
   BALLOON: "Attention!" "Click me to launch Event Viewer!"
)#


#( test3
NoActive
\ this task will crash nnCron

: user_click
   START-APP: "eventvwr.msc"
;
Action:
   2 BalloonIcon !
   ['] user_click OnBalloonClick !
   BALLOON: "Attention!" "Click me to launch Event Viewer!"
)#


can you please tell me if I have done something wrong? why does "test1" work fine but "test2" does nothing and "test3" crashes?

thank you :)
LuckMan212
 
Posts: 133
Joined: Mon, 04 Jul 2005, 11:19

Postby Nicholas_Nemtsev » Thu, 07 Jul 2005, 09:59

You can use START-APP: only inside action or inside words calling from action.
Use StartApp or GUIStartApp for your purpose.
Example for GUIStartApp:
Code: Select all
0 S" mmc.exe %systemroot%\system32\eventvwr.msc" GUIStartApp
Nicholas Nemtsev
User avatar
Nicholas_Nemtsev
Site Admin
 
Posts: 857
Joined: Thu, 01 Jul 2004, 22:25
Location: Псков

Postby LuckMan212 » Thu, 07 Jul 2005, 10:28

ok yes, this is basically same thing as I had given in example#1. Just curious, I found no mention of "GUIStartApp" in the help file, or in the "Thinking Forth" PDF that I downloaded. How would I have known about this keyword?

also, can you tell me difference between StartApp and GUIStartApp?

and do I need to write:
Code: Select all
0 S" mmc.exe %systemroot%\system32\eventvwr.msc" GUIStartApp DROP

or can I just write it like you have:
Code: Select all
0 S" mmc.exe %systemroot%\system32\eventvwr.msc" GUIStartApp
without the DROP at the end. As I understand it, this DROP would simply remove the top item from the stack, which in this case would have been some sort of result code from the launching of the app?? is that right? anyway is it needed?

thanks!! :D
LuckMan212
 
Posts: 133
Joined: Mon, 04 Jul 2005, 11:19

Postby Nicholas_Nemtsev » Thu, 07 Jul 2005, 10:52

LuckMan212 wrote:How would I have known about this keyword?
I have already told to you about this word :)
LuckMan212 wrote:or can I just write it like you have:
Code: Select all
0 S" mmc.exe %systemroot%\system32\eventvwr.msc" GUIStartApp
without the DROP at the end. As I understand it, this DROP would simply remove the top item from the stack, which in this case would have been some sort of result code from the launching of the app?? is that right? anyway is it needed?

StartApp returns flag and you can analyze it or just drop it.
GUIStartApp does not return anything.
Nicholas Nemtsev
User avatar
Nicholas_Nemtsev
Site Admin
 
Posts: 857
Joined: Thu, 01 Jul 2004, 22:25
Location: Псков


Return to nnCron forum (English)

Who is online

Users browsing this forum: No registered users and 1 guest