Can Standalones Do "do"?

Jan Schenkel janschenkel at yahoo.com
Mon Sep 22 10:20:00 EDT 2003


--- Rob Cozens <rcozens at pon.net> wrote:
> Morning all.
> 
> I'm working away polishing up SDB for the LA Run Rev
> Dev meeting on Wednesday.
> 
> Lately I've got a nagging feeling that part of my
> effort is for naught:
> 
> SDB Data Dictionary includes a field where the
> developer can type a 
> validation handler to applied to the field contents
> when the field is 
> closed.  The idea was something like this:
> 
> on closeField
>    global passedData
>    put me into passedData
>    do (field "Validation")
>    if the result is not empty then -- take error
> return
>    [snip]
> end closeFields
> 
> Cool and powerful stuff; but if a standalone can't
> do "do", I'm 
> wasting my time.
> 
> Am I wasting my time?  Is there another way to
> change handlers on-the-fly?
> 
> Rob Cozens
> 

Hi Rob,

The 'do' command should work just fine in standalones,
as long as the script you want to execute is within
the good ol' 10-line limit.

One way to check if the script is any good and within
limits is by making a field "testscript", and use
something like :
  try
    set the script of btn "testscript" to \
        "on test" & return & fld "Validation" & \
        return & "end test"
  catch tError
    # if you get here, something is wrong
    # ...
  end try

To know what to check for, use the msg box and execute
the following :
  edit the script of card "revScript" of \
       stack "revTemplateScriptEditor"
And scroll to the handler 'revCompileScript'

Hope this helped,

Jan Schenkel.

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com



More information about the use-livecode mailing list