There is no way to do so but you can pass default value to it

#macro (Name $var1 $var2 $var3)

        #statement1
        #statement2

#end

call with

#Name(value1 '' '')

Name
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Will Glass-Husain
Sent: Thursday, November 30, 2006 10:11 AM
To: Velocity Users List
Subject: Re: setting missing argument to default in macro or overloading
macro

Well, not really but there's a workaround.  Use a List as a single
parameter

#macro(myMacro $listOfItems)

blah blah $listOfItems.get(1) blah blah

#end

and call with
#myMacro(["abc", "def"])

WILL
On 11/29/06, David Zhao <[EMAIL PROTECTED]> wrote:
> Hi there,
>
> Is there a way to either set a missing argument to a default value, or
> overloading the macro?
> for example, if I have a macro like this:
> #macro (toBeOverLoaded $name $value $size)
> #if ($size < 30)
> #set ($size = 30)
> #end
> ...
> #end
>
> and calling this macro:
> #toBeOverLoaded($name $value), note: $size is not passed.
> Is there any way I can do this?
> Thanks,
>
> David
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Forio Business Simulations

Will Glass-Husain
[EMAIL PROTECTED]
www.forio.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to