I believe that you must supply all arguments on a function you define. Only
built-in functions can have optional parameters AFAIK.
If your intention is to be able to have a default substituted in a function for
missing arguments, then I would pass a null for each parameter to be defaulted.
That way, at the beginning of your function, you could write something like:
if( isNull( optionalD ) ) { optionalD = defaultValueD; }
BR,
Dennis
On Aug 17, 2010, at 4:41 PM, rise_t575 wrote:
>
>
> Thanks. Just created a new, very simple AFL script for testing and it creates
> a "Missing Arguments" error.
>
> --- In [email protected], "Edward Pottasch" <empotta...@...> wrote:
>>
>> yes. You probably made a syntax error. There are examples in the manual,
>>
>> regards, Ed
>>
>>
>>
>>
>> From: rise_t575
>> Sent: Tuesday, August 17, 2010 8:38 PM
>> To: [email protected]
>> Subject: [amibroker] function() - optional parameters?
>>
>>
>>
>> Just wondering if it is possible to use optional parameters in the
>> function() function (no pun intended...), e. g.
>>
>> function Test ( a, b, c, optionalD, optionalE );
>>
>> Would the function call
>>
>> Test( 1, 2, 3 );
>>
>> generally work in this case?
>>
>> I've tried it, but something doesn't seem to work correctly - so I want to
>> make sure that this is generally possible.
>>
>> Thanks in advance!
>>
>
>
>
>
> ------------------------------------
>
> **** IMPORTANT PLEASE READ ****
> This group is for the discussion between users only.
> This is *NOT* technical support channel.
>
> TO GET TECHNICAL SUPPORT send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
> http://www.amibroker.com/feedback/
> (submissions sent via other channels won't be considered)
>
> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
>
> Yahoo! Groups Links
>
>
>