Still not in the .NET era where EVERYTHING is an object 

Even a string 

You could have the likes of

Var
  K : string;
Begin
  K:='chris';
  Showmessage(k.uppercase); // gives CHRIS
  Showmessage(k.reverse); // gives SIRHC
..
..

Anyway just a dream for now!

Chris Albert,
Innovative Technologies.
http://www.it.co.ke/beta
 

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of Nesler, Thomas J
Sent: Monday, August 08, 2005 7:31 PM
To: [email protected]
Subject: RE: [delphi-en] Getting a Dynamic arrays length

That did it!  I didn't realize it was a function. I thought it was a
property of the array.

Thanks!

Tom Nesler


-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Chris @ IT

Try 

length(StrArray)


Chris Albert,
Innovative Technologies.
http://www.it.co.ke/beta
 

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf
Of Nesler, Thomas J

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



-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links



 






------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12hgajva1/M=362329.6886308.7839368.1510227/D=groups/S=1705115362:TM/Y=YAHOO/EXP=1123526023/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!</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/
 



Reply via email to