
-----------------------------------
gsquare567
Sun May 11, 2008 3:55 pm

&quot;variable has no value&quot;
-----------------------------------
2 questions:

1)  How can i get the length of a pre-set array

2)  Why am i not allowed to dynamically initialize an array here : (focus on exactNoteTimes array)

i preset 0 and then in the second last line use it to to make 1, which is used to make 2, etc.

so if i preset 0 then why is i-1 not set? the first run it will pe 1-1 = 0, and 0 is 3000 (note the second line). in the last line i set exactNoteTimes(i) and then the next run it will be i-1, so there should be no problem.




var exactNoteTimes : array 0 .. 300 of int
exactNoteTimes (0) := 3000 


.....................



for i : 1 .. 300 % i is the note number, starting at 1
        %if the note has NOT been sent (variable has not been set yet)
        if noteStatus (i) = 0 then
            %then check if the time is right
            if lastTimeSent + noteTimeIncreases (i)
                    