Passing by Reference?

Dave dave at looktowindward.com
Thu Mar 15 12:00:36 EDT 2007


On 15 Mar 2007, at 15:19, Trevor DeVore wrote:

> On Mar 15, 2007, at 8:00 AM, Dave wrote:
>
>> On 15 Mar 2007, at 14:23, Trevor DeVore wrote:
>>
>>> On Mar 15, 2007, at 4:59 AM, Dave wrote:
>>>
>>>> Does anyone know away around this or do I have to abandon my  
>>>> idea and have two separate GetXY functions?
>>>
>>> I suppose you could pass false instead of empty and check for that.
>>
>> I don't think this would work either. Wouldn't :
>>
>> get GetXY(theDocRef,false,myYValue)
>>
>> by the same as:
>>
>> put false into myXValue
>> get GetXY(theDocRef, myXValue,myYValue)
>
> What I was thinking is that you can pass false for theXValue/ 
> theYValue if you wanted the function to act as if those parameters  
> weren't passed.  Passing empty would mean you passed in an empty  
> value.  With Rev you have to pass a variable as the parameter when  
> passing by reference.  Looking at your first post it doesn't even  
> look like the get code
>
> get PDFGetXY(theDocumentRef,empty, empty)
>
> would execute without an error.  Does it work on your end?

Ahh, ok, I didn't get that far since it didn't work on the case where  
I passed two variables into it. I've abandoned the idea now. I've  
been coding in C this afternoon and I guessed some of that rubbed off  
when I switched back to RunRev. In C you'd pass NULL to the function  
or &myXValue. In function you'd check the value for <> NULL and if so  
store the value. This is a standard way of doing things in C and I  
thought I could use a similar technique in RunRev, it turns out I  
can't. Doesn't really matter,

Thanks a lot for taking the time to look at this
All the Best
Dave




More information about the use-livecode mailing list