GUIStartApp, StartApp, questions...

nnCron and nnCron LITE discussion

GUIStartApp, StartApp, questions...

Postby LuckMan212 » Mon, 21 Nov 2005, 03:51

hello, greetings
Code: Select all
0 S" notepad.exe" StartApp DROP


in this code sample, what is the purpose of the "0" in the beginning? is this so in case the program does return no exit code, then stack will have some value to DROP?

I am curious...

also, it is mentioned that GUIStartApp does not return any value to stack, so therfore is the following code incorrect??
Code: Select all
0 S" notepad.exe" GUIStartApp DROP


is this the "correct" way? :
Code: Select all
S" notepad.exe" GUIStartApp

thank you very much!!! :D
LuckMan212
 
Posts: 133
Joined: Mon, 04 Jul 2005, 11:19

Postby Nicholas_Nemtsev » Mon, 21 Nov 2005, 12:09

Stack notations of these words are:
GUIStartApp ( 'startup-info a u -- )
StartApp ( 'startup-info a u -- flag )
When you use 0 instead address of startup info structure, nncron uses default startup info.
Nicholas Nemtsev
User avatar
Nicholas_Nemtsev
Site Admin
 
Posts: 857
Joined: Thu, 01 Jul 2004, 22:25
Location: Псков

Postby LuckMan212 » Mon, 21 Nov 2005, 18:12

ok thanks Nikolas,
so from your notes I can infer:
Code: Select all
0 S" notepad.exe" GUIStartApp DROP
is incorrect because GUIStartApp returns nothing to stack? is this right?

also I am still a little unclear what you mean by
When you use 0 instead address of startup info structure, nncron uses default startup info

is there any example of when you might use the 0 S" ... notation instead of simply S" ... ? i would be very grateful for such an example... thanks :D
LuckMan212
 
Posts: 133
Joined: Mon, 04 Jul 2005, 11:19

Postby Valery_Kondakoff » Mon, 21 Nov 2005, 20:25

Look: both of the words are expecting 3 values on a stack - address of a startup info structure, addres of a string and the length of a string. When you use '0' instead of the address of a startup info structure - you are using the default startup info.

The code '0 S" notepad.exe" GUIStartApp DROP' will give you an error if there was nothing on a stack before you execute it. For example, this will give an error: '0 S" notepad.exe" GUIStartApp DROP'. And this will not give an error: '12 0 S" notepad.exe" GUIStartApp DROP'

HTH!
CU
VK
User avatar
Valery_Kondakoff
Site Admin
 
Posts: 769
Joined: Thu, 01 Jul 2004, 20:49
Location: Moscow, Russia

Postby LuckMan212 » Tue, 22 Nov 2005, 04:34

ok thanks Valery,
I guess I sort of get it

I still dont really know what a 'startup info structure' is but I guess thats why you guys are the programmers and I'm just a low user :oops:
LuckMan212
 
Posts: 133
Joined: Mon, 04 Jul 2005, 11:19

Postby VK » Tue, 22 Nov 2005, 13:24

CU
VK
User avatar
VK
 
Posts: 680
Joined: Wed, 14 Jul 2004, 19:17

Postby LuckMan212 » Tue, 22 Nov 2005, 18:13

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


Return to nnCron forum (English)

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron