Can ByRef parameter be default nil ?

Charles Yeomans yeomans at desuetude.com
Sat Jun 12 13:33:40 CDT 2004


On Jun 12, 2004, at 12:41 PM, Ruslan Zasukhin wrote:

> On 6/12/04 7:36 PM, "Charles Yeomans" <yeomans at desuetude.com> wrote:
>
>>>>> Does this work in REALbasic ?
>>>>>
>>>>> "foo(inValue as Variant, outCount byref as Integer = nil )"  ?
>>>>
>>>> No, that will not work. A ByRef parameter is always bound to a
>>>> specific
>>>> variable; you cannot pass in Nil instead.
>>>
>>> Ok, thank you Mars.
>>>
>>> You think it is not possible allow ByRef parameter to be nil (in
>>> future)?
>>>
>>>
>>> Compare RB SDK to Macromedia SDK.
>>>
>>>     in Director I can easy have function with 4 params
>>>     and specify that it can have from 2 to 4 params.
>>>
>>>     we have in XDK way to check
>>>
>>>         param count
>>>         param_exists( 3 )
>>>
>>> The same works in pugins for PHP, webSisphon, ...
>>>
>>> I think this is more powerful way that we have now in REALbasic SDK.
>>> Agree?
>>>
>>
>> I think that you should not return values in parameters in Rb.
>
> Hi Charles,
>
> 1) above point about param_exists() is important not always for
>     task "return in param".
>
> 2) then why exists ByRef ?
>     I see only its usage for return of value from function.
>
> 3) we really need this Charles in this function for Valentina 2.0
>
>      ValueExists( inValue as Variant,
>                   outCount byref as Integer,
>                   inSelection as VSet = nill ) as boolean
>
> Return already taken -- boolean,
> But this function may return also additional info.
>
> And we must not make another function, Charles,
> Because it make hard search in the index or even in scan of table's 
> column.

Perhaps; I can't of course say until I see Valentina 2.

--------------
Charles Yeomans



More information about the Valentina-beta mailing list