Passing by Reference?

Dave dave at looktowindward.com
Thu Mar 15 07:59:10 EDT 2007


Hi,

Please take a look at the function below. Basically I was trying to  
make a flexible utility function that returned two values either as a  
List in the return value or as individual (X, Y or X and Y) values.

It could then used as so:

  get PDFGetXY(theDocumentRef,myXValue,myYValue)

or

  get PDFGetXY(theDocumentRef,myXValue,empty)

or

  get PDFGetXY(theDocumentRef,empty, myYValue)

or

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

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.

put empty into myXValue
put empty into myYValue
  get PDFGetXY(theDocumentRef,myXValue,myYValue)

is the same as:

  get PDFGetXY(theDocumentRef,empty, empty)

Does anyone know away around this or do I have to abandon my idea and  
have two separate GetXY functions?

All the Best
Dave


------------------------------------------------------------------------ 
------------
--
--  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






More information about the use-livecode mailing list