Passing by Reference?

Dave dave at looktowindward.com
Thu Mar 15 10:58:02 EDT 2007



On 15 Mar 2007, at 14:35, Ken Ray wrote:

> On Thu, 15 Mar 2007 11:59:10 +0000, Dave wrote:
>
>> However this doesn't seem to work, since it looks like there is no
>> way to tell if you are passing "empty" as apposed to a value that is
>> empty, e.g.
>
> Sorry, Dave, but I don't see the difference... did you want to have
> some different action performed if the constant "empty" is passed vs.
> an empty variable? If so, what are the two different actions?

Well look at the function:

------------------------------------------------------------------------ 
------------
--
--  PDFGetXY
--
------------------------------------------------------------------------ 
------------
function PDFGetXY theDocumentRef, at theXValue, at theYValue
   local myXValue
   local myYValue

   put qrtPDF_GetX(theDocumentRef) into myXValue
   put qrtPDF_GetY(theDocumentRef) into myYValue

   if theXValue <> empty then
     put myXValue into theXValue
   end if

   if theYValue <> empty then
     put myYValue into theYValue
   end if

   return myXValue & "," & myYValue
end PDFGetXY

If I just want the discrete Y value I'd like to be able to do this:

get PDFGetXY(theDocumentRef,empty,myYValue)

if I want just discrete X, then I'd like to be able to do:

get PDFGetXY(theDocumentRef, myXValue, empty)


if I want X and Y as two discrete values, then I'd like to be able to  
do:

get PDFGetXY(theDocumentRef, myXValue, myYValue)

if I want X and Y as a List, I'd like to be able to do:

put PDFGetXY(theDocumentRef, empty, empty) & cr after myXYList


All the Best
Dave







More information about the use-livecode mailing list