Help on scripting languages

Peter McConachie pmccon at bigpond.net.au
Thu Oct 7 10:04:39 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.
> 

Sean
I'm still not certain that we are discussing the same concept.

In Revolution one inserts a front script into the message heirachy using the
command  "insert script of <objectSpecification> into front". The inserted
script has its own keyDownScript which can stop/pass the event.

The point is that all messages are sent to the inserted object *before* they
are passed to the normal target and then up the message heirachy if passed.

I cannot see any equivalent to the insert command. I am very new to Director
and wonder if you could detail exactly how one goes about setting up a front
object that varies the normal event entry point and so gets first crack at
all events. 

Many thanks,
Peter McConachie



More information about the Valentina mailing list