front script back script
Rob Cozens
rcozens at pon.net
Fri Oct 8 12:41:10 EDT 2004
> > Does anyone have an example stack of how and why to use a
> > front/back script?
Hi Tom,
Serendipity Library contains a field, "Keyboard Filter", and a
handler, sdbKeyboardFilterOn:
on sdbKeyboardFilterOn
insert the script of field "Keyboard Filter" of card 1 of stack
"Serendipity_Library.rev" into front
end sdbKeyboardFilterOn
The script of Keyboard Filter traps keyDown & other pertinent
messages (eg: backSpaceKey, returnInField) before any other Rev
control, checks to see if the character is legal input for the field
with focus (eg: it rejects all characters except "0"-"9",<return>,
<enter>, <backSpace> and (optionally) "-", ".", ",", and/or [currency
symbol] for fields set up for numeric input), and only passes legal
input.
The reason this is a frontScript are:
I want to filter out illegal keystrokes before the character
is displayed in the field
I want the filter to trap all keystrokes before any other
handler has a chance to respond
Hope this helps.
--
Rob Cozens, Staff Conservator
Mendonoma Marine Life Conservancy
"Thirty years ago, our fisheries seemed inexhaustible. Today we know
they are not. The fault lies in large measure with man. Man is a
voracious consumer, and modern technology has made it possible for
fishing vessels to harvest the living resources of the seas in
prodigious amounts."
-- Eliot L. Richardson, U.S. Secretary of Commerce, 1975
in "From Abundance to Scarcity" by Michael L. Weber
More information about the use-livecode
mailing list