what is the meaning of ['] in a task? (BalloonClick)

nnCron and nnCron LITE discussion

what is the meaning of ['] in a task? (BalloonClick)

Postby LuckMan212 » Wed, 09 Nov 2005, 23:32

hello,

i see in the example something like this:
Code: Select all
#( test_balloonclick
NoActive
: my-click
  \ some useful activity:
  MSG: "You have destroyed my Balloon!"
;
Action:
    ['] my-click OnBalloonClick !    BALLOON: "Test" "Click me!"
)#
what is the meaning of the ['] in this case? I see also sometimes it has something like
Code: Select all
#( test_balloonclick1
NoActive
Action:
    [NONAME
    \ more useful activity:
    BEEP: 50 500 PAUSE: 200 BEEP: 50 500
    NONAME] OnBalloonClick !    BALLOON: "New test" "Click me now!"
)#

can you please elaborate a little on this syntax? I am not familiar with it. thank you!!! :P
LuckMan212
 
Posts: 133
Joined: Mon, 04 Jul 2005, 11:19

Postby VK » Thu, 10 Nov 2005, 13:47

I'm highly recommending you reading the 'Starting Forth' book if you are planning to use Forth extensively in your tasks.

Here is the link: http://home.iae.nl/users/mhx/sf.html

And here is the answer on your question: http://home.iae.nl/users/mhx/sf9/sf9.html
CU
VK
User avatar
VK
 
Posts: 680
Joined: Wed, 14 Jul 2004, 19:17

Postby LuckMan212 » Thu, 10 Nov 2005, 15:18

thank you Valery I will try to teach myself :wink:
LuckMan212
 
Posts: 133
Joined: Mon, 04 Jul 2005, 11:19

Postby LuckMan212 » Thu, 10 Nov 2005, 16:16

ok well that is somewhat over my head but I will take some more time to try to read that book from the beginning and see if I can learn it.

in the meantime, can I ask a question? :lol:

if I define a word to be executed onBalloonClick, like this:
Code: Select all
['] user_click OnBalloonClick !
BALLOON: "System Notification" "`%cur_folder COUNT%` contains %size_show @% %size_type COUNT% of data that may no longer be in use.  Click here to open the folder so you can review and delete files as needed."
PAUSE: 5000
BALLOON: "" ""

and then later on in the SAME TASK I want to "un-define" this so that clicking a different balloon does nothing, or does smth else, how do I do this? can I just write
Code: Select all
['] user_click2 OnBalloonClick !
and will this overwrite the previous function?
thanks for the help
LuckMan212
 
Posts: 133
Joined: Mon, 04 Jul 2005, 11:19

Postby Nicholas_Nemtsev » Thu, 10 Nov 2005, 18:40

LuckMan212 wrote:and then later on in the SAME TASK I want to "un-define" this so that clicking a different balloon does nothing, or does smth else, how do I do this? can I just write
Code: Select all
['] user_click2 OnBalloonClick !
and will this overwrite the previous function?
thanks for the help

You can be convinced of the own assumption correctness by trying. Naturally, assignment of new value to a variable will change value of this variable.
['] is applied in compilation mode (inside words), and ' is applied in interpretation mode.
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 4 guests