
-----------------------------------
Shamikh
Mon Jun 02, 2008 5:05 pm

Array of proc help
-----------------------------------
I need to create an array of procs. 

var lol : array 0..5 of proc
lol(1):= ole

put lol(1) 




procedure ole
put "ole"
end ole

but it wont work. it says 1 needs to be an identifier any help?

-----------------------------------
richcash
Mon Jun 02, 2008 5:14 pm

RE:Array of proc help
-----------------------------------
You have to declare the procedure before you assign it to your array.

-----------------------------------
Shamikh
Mon Jun 02, 2008 5:16 pm

RE:Array of proc help
-----------------------------------
How do i do that?

-----------------------------------
richcash
Mon Jun 02, 2008 5:23 pm

Re: Array of proc help
-----------------------------------
By putting your procedure before the line(s) where you initialize your array. (You can declare the body of your procedure later if you use the forward and body keywords.) For example :
var lol : array 0 .. 5 of proc p
procedure ole
    put "ole"
end ole
lol (1) := ole

And upon further inspection of your code :
You need to put an identifier for your array of procedures as I did above.
var lol : array 0 .. 5 of proc p

And also you can't put a procedure. You call a procedure. If you want a subprogram that returns a result you have to use a function.
