OK to pass big data in 'the result'?

Jim Ault JimAultWins at yahoo.com
Thu Mar 15 21:29:47 EDT 2007


> Is anyone aware of any drawbacks in using 'the result' as a container for
> passing, say, a bunch of records from one handler to another? Like this:
> 
You might want to pass "by reference", rather than duplication, but no
drawbacks I know of either way.
----------------------  2 examples (1 procedure + 1 function) ---------
on trythisON
  put "" into tRecordList
  combineVars tRecordList
  put tRecordList
end trythisON

on combineVars  @anyNameWeWant
  --this handler will work on -- tRecordList -- directly
  --anyNameWeWant is a pointer that "points to" the original var address
  --no passing involved
  --names don't have to be the same in each handler
  put "sand and seawater" into bucket
  put "sun glasses" into pocket
  put  bucket && pocket into anyNameWeWant
end combineVars

now type " trythisON" into the message box and press Enter

--------------------------------
--copy into a stack script container
on trythisFUNCTION
  put "sand and seawater" into bucket
  put "sun glasses" into pocket
  put "" into ans
  get combinedVars(bucket,pocket,ans)
  put ans
end trythisFUNCTION


function combinedVars @aaa, @bbb, @ccc
  --this function will work on the variables directly
  --no passing involved
  --names don't have to be the same in each handler
  
  answer "the 'aaa' var name = " & aaa
  put aaa && bbb into ccc
  return ""
end combinedVars
---- end copy
now type " trythisFUNCTION" into the message box and press Enter

Jim Ault
Las Vegas

On 3/15/07 4:59 PM, "Phil Davis" <revdev at pdslabs.net> wrote:

> Is anyone aware of any drawbacks in using 'the result' as a container for
> passing, say, a bunch of records from one handler to another? Like this:
> 
> 
> on processRecords
>    getRecords
>    put the result into tRecordList
>    repeat for each line tLine in it
>      -- your code here
>    end repeat
> end processRecords
> 
> 
> on getRecords
>    put the uBigList of stack "XYZ" into tList
>    delete stack "XYZ" -- to remove it from memory
>    return tList
> end getRecords
> 
> 
> Any drawbacks? Speed or memory or other issues?
> 
> I realize there are clearer, cleaner ways to do this... in a new dev (read
> "perfect") world at least. But I'm not in that world at the moment.
> 
> Thanks -
> Phil Davis
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution





More information about the use-livecode mailing list