This message was edited by Phat Nat at 2003-3-31 16:21:12
: Hi! Sorry for this newbie question but I need help with some code just to show me how to create a function which return an array. I can't find any examples anywhere. Please help me.
Don't be sorry. This is a good question. Here is the esiest way to do it:
VAR
TheArray : Array[0..15] Of String;
PROCEDURE Whatever(Num : Byte; S : String; VAR MyArray : Array Of String);
Begin
MyArray[Num] := S;
End;
Begin
Whatever(1,'Hello!',TheArray);
WriteLn(TheArray[0]);
WriteLn(TheArray[1]);
WriteLn(TheArray[2]);
End.
Make sure that you have the
VAR statement in there or else the data will not be returned to your array.
Phat Nat