Hello!
I am using Delphi 5. I need to work with Dynamic arrays. Reading in
the help file it says that:
'Once a Dynamic array has been allocated, you can pass it to the
standard functions Length, High and Low. Length returns the number of
elements in the array, ...'
I can't seem to get this to work. When I try to compile I get this
error:
'[Error] Unit1.pas(34): Record, object or class type required'
Here is some sample code I used to try to figure out how to work with
dynamic arrays:
procedure TForm1.Button1Click(Sender: TObject);
Var
StrArray : Array of String;
I :integer;
begin
SetLength(StrArray,20);
For I := 0 to 19 do Strarray[I]:= IntToStr(I) + 'Data';
label1.Caption := IntToStr(Strarray.length); <-----Error here
end;
************ End of code *****************
What am I doing wrong? I realize this code is contrived but I should be
able to derive what the size of an array is via this method, right?
Thanks in advance!
Tom Nesler
Live long!... Code Well!... and Prosper!... V
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a
href="http://us.ard.yahoo.com/SIG=12hr1hqc1/M=362335.6886445.7839731.1510227/D=groups/S=1705115362:TM/Y=YAHOO/EXP=1123524897/A=2894361/R=0/SIG=13jmebhbo/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOO&cmpgn=GRP&RTP=http://groups.yahoo.com/">In
low income neighborhoods, 84% do not own computers. At Network for Good, help
bridge the Digital Divide!</a>.</font>
--------------------------------------------------------------------~->
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/delphi-en/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/