
-----------------------------------
TheXploder
Wed Jan 28, 2004 12:33 pm

Local Variables That Give a Value to an Array and the Size
-----------------------------------
I'm trying to make a check for words, and with each same procedure check different words and enable bigger arrays: 


proc words (size : int, name1, name2 : string)
    var word : array 1 .. size of string := init (name1, name2)
    for i : 1 .. size
        if word (i) = "Xploder" then
            put "Name matches!"
        else
            put "Name doesn't match!"
        end if
    end for
end words

words (2, "Xploder", "TheXploder")
words (3, "Cool", "Uncool", "TheXploder")


It doesn't seem to work quite right... hope you get where I am going with this, could you please hlep me out...

-----------------------------------
TheXploder
Wed Jan 28, 2004 12:49 pm


-----------------------------------
ohh, fixed it:


proc words (size : int, name1, name2 : string)
    var word : array 1 .. size of string
    word (1) := name1
    word (2) := name2
    for i : 1 .. size
        if word (i) = "Xploder" then
            put "Name matches!"
        else
            put "Name doesn't match!"
        end if
    end for
end words

words (2, "Xploder", "TheXploder")


-----------------------------------
Paul
Wed Jan 28, 2004 12:53 pm


-----------------------------------
Yay! way to go self-help...

-----------------------------------
we64
Wed Jan 28, 2004 1:47 pm


-----------------------------------
:D  :D yeah good job
