Jump to content

limit on number of $cmdline[] parameters.


Guest liontamer
 Share

Recommended Posts

Guest liontamer

when i call my script with parameters its ok up to $cmdline[8] but throws this error at $cmdline[9].

Error: array variable has incorrect number of subscripts or subscript dimension range exceeded.

Is there a limit on the number of paremters that can be passed?

thanks for any info.

Link to comment
Share on other sites

I don't think so. The code listed below works fine for me, although I am using the latest beta (I'm not sure if the stable release would be different.) Double check that you are giving it enough paramaters to use the 10th array element (at least 9 elements used in this case.) You can never access the element $CmdLine[$CmdLine[0] + 1 ]

;this code worked fine when run as follows from the command line:
; test.au3 1 2 3 4 5 6 7 8 9 0 11 12

MsgBox(0, "Input paramters", "# of input paramaters is: " & $CmdLine[0])
MsgBox(0, "Paramater # " & $CmdLine[0], "This paramater is " & $CmdLine[$CmdLine[0]])

Edited to conform to the above post

Edited to add in the URL to the testing version

Edited by pekster

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

Guest liontamer

hmm just installed latest beta(v3.0.102) and now it works.reinstall v3.0.101 and it doesn't work.looks like a bug in v3.0.101 that is somehow fixed in the beta.

I'll report it in the bug section

thanks for your help.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...