Jump to content
Sign in to follow this  
OnTheFly

Array problem

Recommended Posts

OnTheFly

Hi, i'm having a problem with the array $cmdline.

If $CmdLine[0] > 0 Then;Arguments are passed
    For $i = 1 To UBound($CmdLine)
        If $CmdLine[$i] = "-i" Then;Input file
            $inputfile = $CmdLine[$i+1]
        ElseIf $CmdLine[$i] = "-d" Then;Debug
            $debug = True
        EndIf
    Next
EndIf

As long i don't pass any argument it works. But, when i pass a argument i get the error:

Line 5 (File "path_to_the_script"):

If $CmdLine[$i] = "-i" Then
If ^ERROR

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

Share this post


Link to post
Share on other sites
d4rk

If $CmdLine[$i] = NOT "i" Then;Input file


[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Share this post


Link to post
Share on other sites
OnTheFly

If $CmdLine[$i] = NOT "i" Then;Input file
That wasn't really what i meant :) But thanks anyways. And i solved the problem. Now i have another one.. :)

;Dim an array to use when creating the apps in the tray menu
Dim $trayapps[UBound($apps)]
;Dim an array to use when creating the categories in the tray menu
Dim $traycategory[UBound($categories)]
;Create the categories in thye tray menu
For $i = 1 To Ubound($categories)-1
    $traycategory[$i] = TrayCreateMenu($categories[$i])
;Add the apps to the categories
    For $i = 1 To UBound($apps)-1
        $trayapps[$i] = TrayCreateItem($apps[$i], $traycategory[$i])
    Next
Next

That is a piece of my code. And it gives me the error: (41) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:

$trayapps[$i] = TrayCreateItem($apps[$i], $traycategory[$i])

$trayapps[$i] = TrayCreateItem($apps[$i], ^ ERROR

Edited by OnTheFly

Share this post


Link to post
Share on other sites
Valuater

Simply, there are most likely more "apps" than "categories"

8)


NEWHeader1.png

Share this post


Link to post
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
Sign in to follow this  

×