Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Can ByRef parameter be default nil ? (Real Studio Plugins Mailinglist archive)

Back to the thread list
Previous thread: Re: allocation conflict, huge memory leaking!
Next thread: REALGraphics calls dont clip on a plugin control


macosx and unix paths   -   GOLD
  Can ByRef parameter be default nil ?   -   Ruslan Zasukhin
   Re: Can ByRef parameter be default nil ?   -   Mars Saxman
    Re: Can ByRef parameter be default nil ?   -   Ruslan Zasukhin
     Re: Can ByRef parameter be default nil ?   -   Charles Yeomans
      Re: Can ByRef parameter be default nil ?   -   Ruslan Zasukhin

Can ByRef parameter be default nil ?
Date: 12.06.04 17:21 (Sat, 12 Jun 2004 19:21:33 +0300)
From: Ruslan Zasukhin
Hi all,

In C++ we can do this:

bool foo( int param1, int* param2 = NULL );

So we can check if we need return something to param2.

Does this work in REALbasic ?

"foo(inValue as Variant, outCount byref as Integer = nil )" ?

Will this work ?

Of course its possible do this using 2 methods,
But I not like such style very much.

Re: Can ByRef parameter be default nil ?
Date: 12.06.04 17:26 (Sat, 12 Jun 2004 09:26:45 -0700)
From: Mars Saxman
<email address removed> 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.

Mars Saxman
REAL Software

_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Can ByRef parameter be default nil ?
Date: 12.06.04 17:32 (Sat, 12 Jun 2004 19:32:10 +0300)
From: Ruslan Zasukhin
On 6/12/04 7:26 PM, "Mars Saxman" <<email address removed>> wrote:

> <email address removed> 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?

Re: Can ByRef parameter be default nil ?
Date: 12.06.04 17:36 (Sat, 12 Jun 2004 12:36:22 -0400)
From: Charles Yeomans

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

> On 6/12/04 7:26 PM, "Mars Saxman" <<email address removed>> wrote:
>
>> <email address removed> 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.

Charles Yeomans

_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Can ByRef parameter be default nil ?
Date: 12.06.04 17:41 (Sat, 12 Jun 2004 19:41:57 +0300)
From: Ruslan Zasukhin
On 6/12/04 7:36 PM, "Charles Yeomans" <<email address removed>> 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.