Help on scripting languages

Sean Wilson snw at paradise.net.nz
Thu Oct 7 12:22:35 CDT 2004


>FrontScripts in Revolution and Supercard allow a programmer to intercept all
>system messages before they are passed to the object which would be their
>normal destination (target). These can be pre-processed and then passed to
>the normal target or rejected if inappropriate.
>
>If one wanted, for example, to ensure that certain characters could not be
>entered in fields (say because they were reserved delimiters used in
>processing strings or database fields) the simplest way would be to put a
>rawKeyDown handler in a frontScript to reject the message if it contained
>the reserved character(s) or otherwise pass the message  to the normal
>target (possibly for further processing).

And if one wanted to do the same thing in Director you could use the 
keyDownScript and stopEvent/pass to filter keys so it sounds to me like 
similar functionality. But you could also do the same thing in with keyDown 
because the character hasn't been "entered" into the field yet. It depends 
more on at which level you want the filtering to occur.

>  Advantage one script protecting
>multiple objects + no chance that any objects created in the future can
>break the protocol.
>
>The Revolution rawKeyDown message is probably the same as Directors keyDown.
>
>The requirement to enter text and access databases is a task often performed
>in Director/Valentina. For this reason I believe the need is applicable to
>non-card based metaphors.
>
>I just dont know if the concept of frontScripting is possible in Director,
>and if so how it is done.

What you describe can certainly be done and as with lots of tasks in 
Director: there are many ways to skin a cat.

Cheers,
-Sean.




More information about the Valentina mailing list