| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | RE: (1/2) PKT2000 revisio |
On May 31, 1998 10:53am, MARK LEWIS wrote to JOE MARTIN:
JM>> Don't kid yourself, Delphi's strings (Object Pascal) are
JM>> unlimited in length (ie: C style strings)
ML> they are limited to 64k... TP/BP 7.0's PChar, Delphi's stuff and C...
ML> all are nul terminated character arrays and their max length is 64k...
Sorry. Not with Delphi's 32 bit Strings. Those days are over
Delphi still supports the OLD 255 Strings and now Huge Strings which
can be ANY LENGTH allowed by the system.
If you have the Delphi32 compiler, compile this simple code:
{$APPTYPE CONSOLE} // Compile for console mode only
{$O+} // Optimize compiler
{$H+} // Make Default "String" type HUGE strings
// $H- makes String like old Pascal 255 characters or you
// can use "ShortString" or give a length, i.e. String[80].
// You can use AnsiString to force a Huge String as well.
Uses Windows,Classes,SysUtils;
var line : string; // Default is Huge because of $H+
fv : TFileStream; // File stream class object
nlist : TStringList; // String List Class object
i : integer; // 32 bit integer
Begin
//
// Create a 5 MEG string! WOW!
//
SetLength(Line,5000000);
Writeln('Length : ',Length(Line));
// Create a file stream for the nodelist
fv := TFileStream.Create('y:\nodelist\nodelist.149',fmOpenRead);
try
writeln('Nodelist Stream Size : ',fv.size);
// read the nodelist into a STRING!! WOW!
SetLength(Line,fv.size);
fv.ReadBuffer(Line[1],fv.size);
writeln('Nodelist String Size : ',length(Line));
// Create a list of Strings. Move the Nodelist String Buffer
// into the String list! The StringList object will automatically
// parse the crlf (or cr) delimiters.
nlist := TStringList.Create;
try
nlist.SetText(pChar(Line));
writeln('Number of Lines in Nodelist : ',nlist.count);
// display lines in nodelist for mark lewis
for i:= 0 to nlist.count-1 do
begin
if pos('Mark_Lewis',nlist.strings[i]) > 0 then
writeln('Mark Node: ',Nlist.Strings[i]);
end;
finally
nlist.free;
end;
finally
fv.free;
end;
End.
WOW!!!! and here is the results, in case you don't believe me:
Length : 5000000
Nodelist Stream Size : 2101892
Nodelist String Size : 2101892
Number of Lines in Nodelist : 25614
Mark Node:
,120,RemoteAccess_Help_USA,Sanford_NC,Mark_Lewis,1-919-774-5930,9600,CM,XA,V32
,V42b,ZYX
Mark Node:
Host,3634,Fayetteville_Net,Sanford_NC,Mark_Lewis,1-919-499-2088,9600,CM,XA,V32
b,V42b,H16,V32t,V34,U,NC
Mark Node:
,1,Fayetteville_Net_NEC,Sanford_NC,Mark_Lewis,1-919-499-2088,9600,CM,XA,V32b,V
42b,H16,V32t,V34,U,NEC
Mark Node:
,12,Waldo's_Place_USA,Sanford_NC,Mark_Lewis,1-919-774-5930,9600,CM,XA,V32b,V42
b,H16,V32t,V34
Mark Node:
,202,Clapham_Junction,Bedford,Mark_Lewis,44-1234-213510,9600,CM,V32B,V42B,XX,U
,NEC
Mark Node:
,211,Clapham_Mail_System,Bedford,Mark_Lewis,44-1234-355403,9600,MO,V32B,V42B,X
X
hmmmmmmmmmm, I think I am going to use this nodelist searcher
Hector Santos/Santronics
--- Platinum Xpress/Win/Wildcat5! v2.1i
* Origin: Xpress Online! * 305-248-7815 (1:135/382)SEEN-BY: 20/10 200/0 201/0 100 200 209 300 400 407 411 505 600 204/450 205/0 SEEN-BY: 206/0 270/101 490/21 633/267 270 @PATH: 135/382 270/101 201/505 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.