Jump to content

Declaring arrays


Recommended Posts

Hi Good day,

I was searching the forums and found an old post, script, I changed values played with the script, just to see how it goes, and then I tried to changed this  $asKeyWords[100] to $asKeyWords[11] and seems like nothing happened. if I reduced it to 10 I received an error array variable exceeded.

my question is whats the use of declaring this $asKeyWords[11], im a little bit confused..

 

Keywords()

Func Keywords()

    Local $sData, $asKeyWords[11]

    For $i = 0 To 10
        For $j = 1 To 5
            $asKeyWords[$i] &= Chr(Random(65, 90, 1))
        Next
        $sData &= $asKeyWords[$i] & "|"
    Next

MsgBox(0, "", $sData)
EndFunc   ;==>Keywords

 

ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Link to comment
Share on other sites

;If you change that one :

;Local $sData, $asKeyWords[11]
    
;U need change the max $i value here : 

;For $i = 0 To 10





Keywords()

Func Keywords()

    Local $sData, $asKeyWords[2]

    ;For $i = 0 To 10
    For $i = 0 To Ubound($asKeyWords) - 1; That line fix : "if I reduced it to 10 I received an error array variable exceeded." 
        For $j = 1 To 5
            $asKeyWords[$i] &= Chr(Random(65, 90, 1))
        Next
        $sData &= $asKeyWords[$i] & "|"
    Next

MsgBox(0, "", $sData)
EndFunc   ;==>Keywords

 

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

×
×
  • Create New...