[REBOL] Re: How can I do what Launch does?
From: sanghabum:aol at: 17-Apr-2001 15:10
Carl:
> This should do it for you:
>
> top-level?: does [none? system/script/parent]
>
> -Carl
Thanks! Not quite, but enough of a clue to find something that does do what I
want.
Your top-level? means "Am I being typed at the Command Prompt?"
My a.r is already one level down from your top cos it has been invoked by
being double-clicked. I need to check the level in b.r which is DO'd from
a.r. That's another level down.
Fumbling around in the system script area helped me hack this slightly
inelegant test that does the trick:
DoubleClicked?: does [error?
try [system/script/parent/parent/Parent]]
which can be used in b.r:
if DoubleClicked? [Throw "Please run a.r to start this application"]
There is a lot of magic stuff in the system object. And, as far as I can
tell, very little documentation on it. I know you guys are up to your orbs in
development, but do you have a plan to develop a guide to the system object?
At the very least it'd be gracious if Probe could somehow indicate the a
field is release-dependent. That way, it's my fault if I discover and use a
short-lived data item
Thanks again,
Colin.