keeping track of the open cards for update

Peter M. Brigham pmbrig at gmail.com
Fri Jul 26 08:42:10 EDT 2013


Another question that should be tested with a benchmarking procedure. However, I doubt that even needing to update 50-100 fields would show much variation no matter which technique you decided on. It would begin to matter if you had a thousand windows open and several thousand fields, which is unlikely, :-).

If you go with your initial solution, however, you have to use "short ID" (the straight "ID" contains more than one word), and you have to declare your global variables, either at the start of the script, or within each handler that uses them (you probably knew that).

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig
 
On Jul 25, 2013, at 10:47 AM, Dr. Hawkins wrote:

> As my project moves along, it's handling remote updates of data and
> displaying it live locally (watches for database updates).
> 
> I'm about to move on to making these live in multiple windows (i.e.,
> the input window, and one or more output windows).  This means that
> the update code needs to quickly deal with all the open windows.
> Typically either one or up to a half-dozen fields would update in any
> open window--but as many as 50 or even 100  could happen under certain
> circumstances.
> 
> For keeping track of upon windows, it seems that something like
> 
> on openCard
> ...
>  put space & the id of this card after gUpdateCards
> end openCard
> 
> on closeCard
>  replace space & the id of this card with upty in gUpdateCards
> end closeCard
> 
> 
> and then, something like
> 
> repeat for each word cdid in gUpdateCards
>  if exists fld upFld of cd cdId then
>    do stuff to put it in the field
>  end if
> end repeat
> 
> or will it be faster to keep lists in variables, arrays, or custom
> properties of cards?
> 
> if upFld is among the updateFields of cd cd id then . . .
> 
> OR
> 
> if upFld is among the keys of upFlds[cdid][upFld] then . . .
> 
> 
> thanks for ny thoughts
> 
> -- 
> Dr. Richard E. Hawkins, Esq.
> (702) 508-8462
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list