Making the move...

Rob Cozens rcozens at pon.net
Wed Mar 22 11:29:43 EST 2006


Geoff,

>  -- breaking out routines for local vs. server connection
>

Client selection [server opens all dbs as local connections]:

     replace return with numToChar(29) in itemList
     replace return with numToChar(29) in searchCriteria
     requestSDBService  
sdbBuffer,"find",packArguments(9,exactKey,fieldDelimiter,itemList,setPos 
ition,searchForward,searchCriteria,cutoffKey,recordDelimiter,unlockRecor 
d)
     get the result
     if not word 1 of it and setPosition then put word 4 of it into  
sdbPosition
     put it into sdbParameters
     return it

Every db access call has similar logic, but the second and third  
arguments are unique.  To generalize:

     replace return with numToChar(29) in itemList
     replace return with numToChar(29) in searchCriteria
     put  
packArguments(9,exactKey,fieldDelimiter,itemList,setPosition,searchForwa 
rd,searchCriteria,cutoffKey,recordDelimiter,unlockRecord) into  
packedArguments
     doGeoffsHandler sdBuffer,"find",packedArguments
     return the result

on doGeoffsHandler @sdBuffer,serviceType,packedArguments
     requestSDBService sdbBuffer,serviceType,packedArguments
     get the result
     if not word 1 of it and setPosition then put word 4 of it into  
sdbPosition
     put it into sdbParameters
     return it
end doGeoffsHandler

I've saved two lines in the original handler...for what--the need to  
look up another handler to see the full picture?

Rob Cozens
CCW, Serendipity Software Company

"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."

from "The Triple Foole" by John Donne (1572-1631)




More information about the Use-livecode mailing list