database questions

Alex Rice alrice at ARCplanning.com
Mon Aug 4 12:11:00 EDT 2003


On Sunday, August 3, 2003, at 03:59  PM, Alex Rice wrote:
> function dataField pKey
>   put the customProperties of stack kDataStack into tData
...
>   However I haven't needed to do much optimization yet though. I 
> suspect that dataField(key) function above could be written better.
>

(following up own post)

It seems that avoiding a copy of the custom property array speeds 
things up quite a bit for larger data sets.

function dataField pKey
   put the db_state["databaseID"] of stack kDataStack into tDB
   put sessionID() , pKey , "value" into tFilter
   put format("the %s[\"%s\"] of stack \"%s\"", tDB, tFilter, 
kDataStack) into tx
   return value(tx)
  end dataField

on setDataField pKey, pValue
   put the db_state["databaseID"] of stack kDataStack into tDB
   put sessionID() , pKey , "value" into tFilter
   put format("set the %s[\"%s\"] of stack \"%s\" to pValue", \
       tDB, tFilter, kDataStack) into tx
   do tx
end setDataField


Alex Rice, Software Developer
Architectural Research Consultants, Inc.
http://ARCplanning.com




More information about the use-livecode mailing list