triggering scripts on other cards

Dr. Hawkins dochawk at gmail.com
Sun Jul 15 17:00:03 EDT 2012


I have cases where my defaults "cascade".  It's one of the advantages
of what I'm doing over the competition.

It's easy to handle on a single card, or when the information is
inherited before the card loads, but now I want to make sure that I'm
not about to blow my foot off.

My cards load all of their values from a database when opened.  In
this part of the program, the hypercard stack is a more natural way to
handle things (and which would probably solve this), but that won't
handle the cloud and access from different computers.

So card A changes a value which becomes a default for card B.  If card
B will load with certainty, no problem (well another issue is actually
 causing the dependent value to save, but solving this solves that).

I can set the db value the other field uses, and then send a message
to the object that would normally check the default (and use either
the default or the override value).  Changing this, though, may
cascade further, necessitating running scripts on the other card.

I can access the name of the card from "word 5 of the long name of the
target" (btw:  is there a better way to do this?), but having to
specify the card of each field reference while operating on that page
is just asking to miss one and have a crash-grade bug ship.

Do I want to do a "lock screen, push card, send message, pop card,
unlock screen"?  this seems to solve it if things stay on that crd,
but what if it cascades to another?  (this is why it too gigahertz
class machines for my spreadsheets that do this to be
practical--nested lookups on large regions; I think I figured one
region was O(4) . . .)

Anyway, the snake I see lurking in the grass is if the called card
needs to call another.  Then it locks the screen again, unlocks it,
and, whoops!, the user sees cards popping around.

Maybe rather than locking, a lckscrn() and unlckscrn() pair that
increment a global counter for this? only actually unlocking when
called at depth 1?

Or is there an easy way that I'm missing?

I thought of changing the default card; if this could be done locally
for a routine (like the annoyingly fleeting numberFormat), it would
solve it.  However, there seems to be no such notion as a default
card; just default stacks

-- 
The Hawkins Law Firm
Richard E. Hawkins, Esq.
(702) 508-8462
HawkinsLawFirm at gmail.com
3025 S. Maryland Parkway
Suite A
Las Vegas, NV  89109




More information about the use-livecode mailing list