[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] How to define a function that can accept arbitrary number
From: |
Aharon Robbins |
Subject: |
Re: [bug-gawk] How to define a function that can accept arbitrary number of arguments? |
Date: |
Mon, 02 May 2016 06:42:06 +0300 |
User-agent: |
s-nail v14.8.6 |
Hi.
There is no way to define an awk function that takes an arbitrary number
of arguments. You can either define a function that take a large
number of arguments, say 10, and just call it each time with a differing
number of values and rely on awk to initialize the rest to zero, or you
can define your function to take an array parameter, which can then contain
an arbitrary number of elements.
Sorry.
Arnold
> Date: Fri, 29 Apr 2016 19:25:59 -0500
> From: Peng Yu <address@hidden>
> To: address@hidden
> Subject: [bug-gawk] How to define a function that can accept arbitrary
> number of arguments?
>
> Hi, I see that there are built-in functions in gawk that can accept
> arbitrary number of arguments. How to define one with accept arbitrary
> number of arguments by the users? Thanks.
>
> and(v1, v2 [, ...]) Return the bitwise AND of the values
> provided in the argument list. There
> must be at least two.
> --
> Regards,
> Peng
>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [bug-gawk] How to define a function that can accept arbitrary number of arguments?,
Aharon Robbins <=