Hi,
Does anyone know how many parameters or arguments I can pass to a
function?
Thanks,
K
Hi,
Does anyone know how many parameters or arguments I can pass to a
function?
Thanks,
K
no restriction
--
http://www.alvas.net - Audio tools for C# and VB.Net developers
"Kryten" <Kryten68@xxxxxx> ???????/???????? ? ???????? ?????????:
news:1194302311.448061.81120@xxxxxx
> Hi,
> Does anyone know how many parameters or arguments I can pass to a
> function?
>
> Thanks,
> K
>
On 5 Nov, 22:54, "Alexander Vasilevsky" <al...@xxxxxx> wrote::-))))
> no restriction
Thank You!
K
"Kryten" <Kryten68@xxxxxx> wrote in message
news:1194302311.448061.81120@xxxxxx
> Hi,
> Does anyone know how many parameters or arguments I can pass to a
> function?
>
> Thanks,
> K
>
Just tried 10000 arguments here, which worked fine
(got bored waiting for 100000 to finish , sorry ;-) ....
function HowManyArgs {
$i=0
ForEach ($k in $Args) {$i=$i+1}
$i
}
$expr = "HowManyArgs "
foreach ($m in 1..10000) {$expr = $expr + ($m.ToString()) + ' '}
invoke-expression $expr
--
Jon
$args is an array object, I don't think there's a limit unless there's a
limit to the array object.
-----
Shay Levi
$cript Fanatic
http://scriptolog.blogspot.com
> Hi,
> Does anyone know how many parameters or arguments I can pass to a
> function?
> Thanks,
> K
"Shay Levi" <no@xxxxxx> wrote in message
news:8766a944c6e58c9ee2be925e1e6@xxxxxxWell the max index is 2GB - 1. But even with 10000 args tested (and
> $args is an array object, I don't think there's a limit unless there's a
> limit to the array object.
>
verified), I'd say there is no "practical" limit. :-)
--
Keith
Thanks for the info.
-----
Shay Levi
$cript Fanatic
http://scriptolog.blogspot.com
> "Shay Levi" <no@xxxxxx> wrote in message
> news:8766a944c6e58c9ee2be925e1e6@xxxxxx
>> Well the max index is 2GB - 1. But even with 10000 args tested (and
>> $args is an array object, I don't think there's a limit unless
>> there's a limit to the array object.
>>
> verified), I'd say there is no "practical" limit. :-)
>
> --
> Keith
Correct. The only limits are [int32]::MaxValue and the amount of memory you
have on your system.
-bruce
--
Bruce Payette [MSFT]
Principal Developer, Windows PowerShell
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
Visit the Windows PowerShell Team blog at:
http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at:
http://www.microsoft.com/technet/scr.../hubs/msh.mspx
My Book: http://manning.com/powershell
"Keith Hill [MVP]" <r_keith_hill@xxxxxx_no_spam_I> wrote in message
news:570383FA-667C-4227-85CE-C5692EE3ED00@xxxxxx
> "Shay Levi" <no@xxxxxx> wrote in message
> news:8766a944c6e58c9ee2be925e1e6@xxxxxx>
>> $args is an array object, I don't think there's a limit unless there's a
>> limit to the array object.
>>
> Well the max index is 2GB - 1. But even with 10000 args tested (and
> verified), I'd say there is no "practical" limit. :-)
>
> --
> Keith
| Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Function parameters question | Philip Colmer | PowerShell | 3 | 11 Aug 2008 |
| XML node passed to function | David Trimboli | PowerShell | 4 | 15 Jul 2008 |
| Howto: pass all args to a sub function? | Staffan Gustafsson | PowerShell | 3 | 23 May 2007 |
| Defining function parameters | Ted Brewster | PowerShell | 1 | 13 Dec 2006 |
| How To: Use Parameters sent to a function regardless of order | Brandon Shell | PowerShell | 3 | 24 Aug 2006 |