Trying to understand TStringDynArray

I've been away from programming a while.  While coding a simple project, 
I've come across TStringDynArray.  The below code snippet I've entered 
magically works (I'm using XE4), no errors, no warnings, no hints.

In the (distant) past, I recall having to set the length of a dynamic 
array.  That's no longer needed?  Am I creating some memory leak with 
the below code?  No need to free up memory?

Thanks,

Bob Lincoln

==================================================


procedure TForm1.btnZipFolderClick(Sender: TObject);
var
   DirToZip: string;
   ZipList: TStringDynArray;
   I: integer;
begin

   DirToZip := 'C:\Users\My Name\Desktop\My Folder';

   ZipList := TDirectory.GetFiles(DirToZip, '*', 
TSearchOption.soAllDirectories);

   for I := 0 to Length(ZipList) do
     ListBox1.Items.Add(ZipList[I]);

end;
0
Robert
9/2/2013 7:08:12 PM
embarcadero.delphi.general 4258 articles. 0 followers. Follow

16 Replies
7492 Views

Similar Articles

[PageSpeed] 59

Actually, the for loop should be:

   for I := 0 to Length(ZipList) - 1 do
     ListBox1.Items.Add(ZipList[I]);


On 9/2/2013 12:08 PM, Robert Lincoln wrote:
> I've been away from programming a while.  While coding a simple project,
> I've come across TStringDynArray.  The below code snippet I've entered
> magically works (I'm using XE4), no errors, no warnings, no hints.
>
> In the (distant) past, I recall having to set the length of a dynamic
> array.  That's no longer needed?  Am I creating some memory leak with
> the below code?  No need to free up memory?
>
> Thanks,
>
> Bob Lincoln
>
> ==================================================
>
>
> procedure TForm1.btnZipFolderClick(Sender: TObject);
> var
>     DirToZip: string;
>     ZipList: TStringDynArray;
>     I: integer;
> begin
>
>     DirToZip := 'C:\Users\My Name\Desktop\My Folder';
>
>     ZipList := TDirectory.GetFiles(DirToZip, '*',
> TSearchOption.soAllDirectories);
>
>     for I := 0 to Length(ZipList) do
>       ListBox1.Items.Add(ZipList[I]);
>
> end;
>
0
Robert
9/2/2013 7:24:38 PM
Robert wrote:

> In the (distant) past, I recall having to set the length of a
> dynamic array.

If you are allocating the array yourself, then yes.  That is not the case 
in your example.

> Am I creating some memory leak with the below code?
> No need to free up memory?

No, you are not creating a memory leak.  TDirectory.GetFiles() allocates 
and returns its own dynamic array of strings, which you are then taking ownership 
of.  A dynamic array is reference counted.  When your local ZipList variable 
goes out of scope, the array will be freed because its reference count falls 
to 0.

--
Remy Lebeau (TeamB)
0
Remy
9/2/2013 7:35:27 PM
Robert Lincoln wrote:

> I've been away from programming a while.  While coding a simple
> project, I've come across TStringDynArray.  The below code snippet
> I've entered magically works (I'm using XE4), no errors, no warnings,
> no hints.
> 
> In the (distant) past, I recall having to set the length of a dynamic 
> array.  That's no longer needed?  Am I creating some memory leak with 
> the below code?  No need to free up memory?

There is no magic involved here. TStringDynArray is an array of string,
and the code behaves exactly as if it were declared with ZipList: array
of string. The TDirectory.GetFiles function returns a dynamic array it
has sized and filled with the files to return internally. And like for
any other dynamic array the compiler adds code to make sure the memory
for the array is released when the array variable goes out of scope.

> procedure TForm1.btnZipFolderClick(Sender: TObject);
> var
>    DirToZip: string;
>    ZipList: TStringDynArray;
>    I: integer;
> begin
>    DirToZip := 'C:\Users\My Name\Desktop\My Folder';
>    ZipList := TDirectory.GetFiles(DirToZip, '*',
TSearchOption.soAllDirectories);
>    for I := 0 to Length(ZipList) do
>      ListBox1.Items.Add(ZipList[I]);


-- 
Peter Below (TeamB)
0
Peter
9/2/2013 7:36:06 PM
Robert wrote:

> Actually, the for loop should be:
> 
> for I := 0 to Length(ZipList) - 1 do
> ListBox1.Items.Add(ZipList[I]);

You can alternatively use a for..in loop instead:

{code:delphi}
var
  filename: string;

for filename in ZipList do
  ListBox1.Items.Add(filename);
{code}

--
Remy Lebeau (TeamB)
0
Remy
9/2/2013 7:36:20 PM
Peter wrote:

> The TDirectory.GetFiles function returns a dynamic array it has sized and
> filled with the files to return internally.

An array that is sized quite inefficiently, I might add - it is resized/reallocated 
on every single file that is found.  Embarcadero should know better than 
to do that on (potentially) large lists.  I would think it would be better 
to add the files to a TStringList first, and then allocate+fill the final 
array only once from that.  And then maybe they should forget the array altogether 
and just return the TStringList itself (or let the caller pass in a TStrings 
to be filled).  Sometimes I worry about what Embarcadero designers are thinking 
when they design public interfaces with inefficient implementations.

--
Remy Lebeau (TeamB)
0
Remy
9/2/2013 8:46:49 PM
Peter,

| There is no magic involved here. TStringDynArray is an array of
| string, and the code behaves exactly as if it were declared with
| ZipList: array of string. The TDirectory.GetFiles function returns a
| dynamic array it has sized and filled with the files to return
| internally.

Do you know if XE and later know how to handle both Unicode and ANSI
strings in TStringDynArray?  (I'm to busy at the moment to play with
it. <g>)

-- 

   Q 

09/02/2013 13:56:09

1.19.1.372  [Q'sBrokenToolBar] [Running on TQ]
0
Quentin
9/2/2013 8:58:49 PM
Where can one find the code for TDirectory.GetFiles?  When I look in 
System.IOUtils.pas, I just see a call to GetFiles().  Where does that 
come from?

In other words, how can one know:

"... it is resized/reallocated on every single file that is found."


Also, thanks for everyone's responses so quickly.  I obviously need to 
go back and relearn some things.

Bob Lincoln





On 9/2/2013 1:46 PM, Remy Lebeau (TeamB) wrote:
> Peter wrote:
>
>> The TDirectory.GetFiles function returns a dynamic array it has sized and
>> filled with the files to return internally.
>
> An array that is sized quite inefficiently, I might add - it is resized/reallocated
> on every single file that is found.  Embarcadero should know better than
> to do that on (potentially) large lists.  I would think it would be better
> to add the files to a TStringList first, and then allocate+fill the final
> array only once from that.  And then maybe they should forget the array altogether
> and just return the TStringList itself (or let the caller pass in a TStrings
> to be filled).  Sometimes I worry about what Embarcadero designers are thinking
> when they design public interfaces with inefficient implementations.
>
> --
> Remy Lebeau (TeamB)
>
0
Robert
9/2/2013 9:24:15 PM
Quentin wrote:

> Do you know if XE and later know how to handle both Unicode
> and ANSI strings in TStringDynArray?

TStringDynArray only knows about the "string" data type, which is Ansi in 
D2007 and earlier, and Unicode in D2009 and later.  You can certainly declare 
"array of AnsiString" in your own code, but you can't make the RTL use it. 
 The RTL/VCL is almost exclusively Unicode nowadays (if you don't count Ansi-oriented 
functions that are still provided for backwards compatibility purposes).

--
Remy Lebeau (TeamB)
0
Remy
9/2/2013 9:28:49 PM
Robert wrote:

> Where can one find the code for TDirectory.GetFiles?

System.IOUtils.pas in the $(BDS)\source\rtl\common folder.

> When I look in System.IOUtils.pas, I just see a call to GetFiles().
> Where does that come from?

TDirectory.GetFiles() calls TDirectory.DoGetFiles(), which calls TDirectory.WalkThroughDirectory() 
with a callback function that adds each matching file to the Result array, 
resizing the array each time.

> In other words, how can one know:
> 
> "... it is resized/reallocated on every single file that is found."

By this code in TDirectory.DoGetFiles():

{code:delphi}
if CanAdd then
begin
  SetLength(ResultArray, Length(ResultArray) + 1);
  ResultArray[Length(ResultArray) - 1] := TPath.DoCombine(Path, FileInfo.Name, 
False);
end;
{code}

--
Remy Lebeau (TeamB)
0
Remy
9/2/2013 9:50:17 PM
Remy,

That's pretty much what I would have guessed.

Thanks!!! 


-- 

   Q 

09/02/2013 15:31:13

1.19.1.372  [Q'sBrokenToolBar] [Running on TQ]
0
Quentin
9/2/2013 10:32:40 PM
Remy Lebeau (TeamB) wrote:

> Peter wrote:
> 
> > The TDirectory.GetFiles function returns a dynamic array it has sized and
> > filled with the files to return internally.
> 
> An array that is sized quite inefficiently, I might add - it is resized/reallocated 
> on every single file that is found.  Embarcadero should know better than 
> to do that on (potentially) large lists.  I would think it would be better 
> to add the files to a TStringList first, and then allocate+fill the final 
> array only once from that.  And then maybe they should forget the array altogether 
> and just return the TStringList itself (or let the caller pass in a TStrings 
> to be filled).  Sometimes I worry about what Embarcadero designers are thinking 
> when they design public interfaces with inefficient implementations.

Or they could size the return list to some UWAG (unscientific wild-ass guess) size and track the file count, bumping the list occasionally, and then set the Length when they're done.
Actually, that's pretty much what the original TStringList did.

-- 
John
0
John
9/3/2013 3:01:30 AM
Robert,

> Actually, the for loop should be:
> 
>    for I := 0 to Length(ZipList) - 1 do
>      ListBox1.Items.Add(ZipList[I]);

as Remy said you can also use a for-in-loop or the old Low and High
functions.

{code: Delphi}
    for I := Low(ZipList) to High(ZipList) do
      ListBox1.Items.Add(ZipList[I]);
{code}

-- 
Roman Kassebaum
Embarcadero Technology Partner
Embarcadero MVP
Roman's Blog: http://blog.kassebaum.eu
0
Roman
9/3/2013 5:24:20 AM
Remy Lebeau (TeamB) wrote:

> Peter wrote:
> 
> > The TDirectory.GetFiles function returns a dynamic array it has sized and
> > filled with the files to return internally.
> 
> An array that is sized quite inefficiently, I might add - it is resized/reallocated 
> on every single file that is found.  Embarcadero should know better than 
> to do that on (potentially) large lists.  I would think it would be better 
> to add the files to a TStringList first, and then allocate+fill the final 
> array only once from that.  And then maybe they should forget the array altogether 
> and just return the TStringList itself (or let the caller pass in a TStrings 
> to be filled).  Sometimes I worry about what Embarcadero designers are thinking 
> when they design public interfaces with inefficient implementations.

Or they could size the return list to some UWAG (unscientific wild-ass guess) size and track the file count, bumping the list occasionally, and then set the Length when they're done.
Actually, that's pretty much what the original TStringList did.

-- 
John
0
John
9/3/2013 4:38:57 PM
John Treder wrote:

Dunno why Xananews pumped this again this morning.
-- 
Tredmill
0
John
9/3/2013 4:45:00 PM
Quentin Correll wrote:

> Peter,
> 
> >  There is no magic involved here. TStringDynArray is an array of
> >  string, and the code behaves exactly as if it were declared with
> >  ZipList: array of string. The TDirectory.GetFiles function returns
> > a  dynamic array it has sized and filled with the files to return
> >  internally.
> 
> Do you know if XE and later know how to handle both Unicode and ANSI
> strings in TStringDynArray?  (I'm to busy at the moment to play with
> it. <g>)

TStringDynArray is simply an array of string, i.e. of one single type.
That will handle the string type that is currently aliased to "string".
Other types will be converted, if this is implicitly possible.

-- 
Rudy Velthuis (TeamB)    http://www.teamb.com

"I'm all in favor of keeping dangerous weapons out of the hands 
 of fools. Let's start with typewriters."
-- Frank Lloyd Wright (1868-1959)
0
Rudy
9/4/2013 12:03:17 PM
Rudy,

| TStringDynArray is simply an array of string, i.e. of one single type.
| That will handle the string type that is currently aliased to
| "string".  Other types will be converted, if this is implicitly
| possible.

Thanks! 


-- 

   Q 

09/04/2013 10:44:47

1.19.1.372  [Q'sBrokenToolBar] [Running on TQ]
0
Quentin
9/4/2013 5:45:50 PM
Reply:

Similar Artilces:

What generals generally do
Reading a McChrystal thread elsewhere, I came across someone quoting a US general http://en.wikipedia.org/wiki/Smedley_Butler > I spent 33 years and four months in active military service and > during that period I spent most of my time as a high class thug for > Big Business, for Wall Street and the bankers. In short, I was a > racketeer, a gangster for capitalism. I helped make Mexico and > especially Tampico safe for American oil interests in 1914. I helped > make Haiti and Cuba a decent place for the National City Bank boys to > collect revenues in. I helped in the raping of half a dozen Central > American republics for the benefit of Wall Street. I helped purify > Nicaragua for the International Banking House of Brown Brothers in > 1902–1912. I brought light to the Dominican Republic for the American > sugar interests in 1916. I helped make Honduras right for the > American fruit companies in 1903. In China in 1927 I helped see to it > that Standard Oil went on its way unmolested. Looking back on it, I > might have given Al Capone a few hints. The best he could do was to > operate his racket in three districts. I operated on three > continents.[12] > Well, I wish the current generals would admit 1/1000 that much! -- Igor > http://en.wikipedia.org/wiki/Smedley_Butler > >> I spent 33 years and four months in active military service and >> during that period I s...

Trying to understand
Ok, I'm been trying to understand the new ADO.net thing, and it seems pretty simple, as long as your using databound controls.Unfortunatly, I have a lot of pages that I can just ad a grid view to and make the things look right, so I'm trying to understand how to programatically access ADO.net.Below is an example of some of the simplest code I need to convert and any help would be aprreciated.set connectionToDatabase=server.createobject("adodb.connection")connectionToDatabase.connectiontimeout=60connectionToDatabase.open "DSN=ServiceCalls"set rc=server.CreateObject...

trying and trying
Name: otto de koningh Email: ottodotdedotkoninghatskynetdotbe Product: Firefox Release Candidate Summary: trying and trying Comments: what a weird robot !! please refrain from using these horrendous figures i like the motorcycle though shown on the add-ons page i am having trouble because there is an unknown dump on firefox - never encountered this ! your browser is otherwise top of the bill !! from Firefox Setup 1.5.0.3 onwards in May 2006 Firefox has become a true companion ! now with Firefox Setup 3.0 RC1 i have error reports ! how come ? Browser Details: Mozilla/5.0 (...

HELP! Trying to Complie old Delphi program on any version of Delphi
Hey everyone I'm new to the programming world and unfortunately I have come across a big problem that I will hope I can get some help with. I have a program that was apparently created using delphi 3 and then finished using delphi 4 with some additional parts added later. I have found copies of amost every version of delphi ever made and installed them on my pc and attempted to compile this program in question. Unfortuantely I have yet to get it to compile without a few thousand error messages and I am st uck between a rock and a hard place. I know very little of Delphi programming, let alone programming itself. I have to get this program to compile so I can make some changes to the program. By trade I am a PLC programmer and I program in ladder logic, so I understand generally how I can make things work. I don't have much experience with structured text programming or C or C+ which makes this all the more complicated for me. I have gone through quite a few tutorials various websites and forums had up to teach yourself how to navigate through the Delphi interface as well as how the basics of a program are created. I have created some simple windows based programs already using the tutorials, and generaly understand the structure of a program made with delphi. I know the program I need to compile works because it is running even right now on a server, I just need to make some changes. I was told it is not easy to just make a program compile without finding out...

Trying to understand...
Someone just hit me over 70 times inside 3 minutes on TCP ports over 63700 from 200.192.240.8. I dropped my connection and picked up a new IP, but is there really anything other than an attempt to invade my box that this kind of activity could be? Just trying to get an education... nospam@myaddress.com wrote: > > Someone just hit me over 70 times inside 3 minutes on TCP ports over > 63700 from 200.192.240.8. I dropped my connection and picked up a new > IP, but is there really anything other than an attempt to invade my box > that this kind of activity could be? J...

delphi.general
Sorry if this is "out of topic"! but since some days ago I can't read the group *embarcadero.public.delphi.language.delphi.general* Does anybody know if there's something wrong with it? Or maybe is my reader? (Thunderbird) I get this messagge when I try to read the latest messages: Error! newsgroup server responded:no such article found Perhaps the article has expired <692702@forums.embarcadero.com> (33145) Click here to remove all expired articles sergio wrote: > Sorry if this is "out of topic"! but since some days ago I can'...

Trying to call a .DLL from Delphi XE (used to work with Delphi 6 :-) )
Hi everyone, I have a problem where perhaps some one could help point me in the right direction. In Delphi 6 I used a stand alone package to train a neural netowrk,. The trained neural network was stored as a .DEF file. The standalone software provided a .DLL and Delphi code to call the network and get the prediced values from your sw. (The .DLL was created in 2002 and apparently is 32 bit.) I have'nt used it for years but am now coming back to it.... I now use Delphi XE on Windows 7 (32 bit) The old .exe's I had compiled from that time work fine. However in Delphi XE when I try to compile the code below it seems that the call to the .DLL does'nt work Does anyone have any suggestions. I apologise for the length of this email. Kind regards, Adrian unit ns2delxe; {$F+,N+} interface type Pdouble = ^double; function OpenNet(Path: string; var NetNum, NumInputs, NumOutputs: smallint): smallint; stdcall; function FireNet(var NetNum: smallint; InAr, OutAr: Pdouble): smallint; stdcall; function CloseNet(var NetNum: smallint): smallint; stdcall; implementation function OpenNet; external 'NS2-32.DLL'; function FireNet; external 'NS2-32.DLL'; function CloseNet; external 'NS2-32.DLL'; end. procedure FireNetFromDelphi2; var PascalPath: string; {name of the definition file in Pascal notation} CPath : Pchar; {pointer to the name of the definition file in C n...

Trying to understand backup
I'm trying to figure out how a database backup works. Suppose I back up the database and transaction log, and truncate the log. The next day I back up just the log. A couple of days later I want to restore to the second backed-up version. I restore the first backup database and log, then run the engine with '-a' to apply changes from the second log. First, is that the correct procedure? Second, did I really need the first backup log to do that? In other words, if I back up a database and truncate the log, is there anything in the pre-truncate log that I need to rest...

Still trying to understand..
Hey fellow Linux users! Let me introduce myself to all of you, my name is Ben and I'm a recent Suse 11.0 installer/user/novice. Let me start by saying Linux is so amazing. I love the interface and its super stable and quick. I'd choose this over windows anyday! I recently got a little interested in linux about 3 years ago when one of my Compute teachers gave me a Live Knoppix Cd. And I thought it was the coolest thing ever. But I still have a little dificulty understanding how linux works. I mean I read alot of websites and everything but its still a little confusing to me....

Trying to understand the basics
Hi, I'm trying to understand the basics about securing my pc. I have a good anti-virus updated daily and a good trojan cleaner. I have ZA, set to high security, I don't give automatic permission to anything. I've run various probes and tests from several sites and I am completely stealthed. The thing that puzzles me, but might be clear to someone in the know is this....I am connected to a website, so in theory I have an open port at this moment. Can someone with malicious intent slip into my pc through this open port while I am browsing just now? Sorry if this has been as...

Trying to understand the stylesheet
If we give so many font names in the style sheet, which font is taken into consideration. Could any one explain me what this means. .Default { font-size:12px; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; } The font-family declaration is a list of "preferred" fonts, listed in order of preference. If the visitor's computer has Verdana installed, then Verdana will be the font used to render the page. If the visitor's computer does not have Verdana installed but has Arial installed, then Arial will be the font used to render the page. If the visitor's comp...

Trying to understand DLL.
Hi all,I have my application in 2.0 in which i have two projects. Project1 and project2. In the bin folder of my project1 im referencing the project2 by using the project2.dll. i dont understand this paritcular points:->whenever i compile the project2, a debug folder is automatically created inside the bin folder of the project2. Inside the debug folder a project2.dll is automatically created.-> whenever i compile the project1, no debug folder is automatically created inside the bin folder of the project1.->So whenever i compile the project1 is aproject1.dll created? If so where is...

Trying to understand some things
I'm not very technical, so I apologize in advance if what I'm asking doesn't quite make sense. I have a Maxtor 80GB drive that was my primary drive until it started having data and OS corruption problems. I ran the Maxtor utility Powermax and the basic test indicated the drive needed advanced testing. The advanced test indicated that the drive was failing. I did NOT do a Powermax low level format. The exisiting data on the drive was unimportant because it had been backed up, but I was hoping to "fix" the drive in hopes of using it for occassional backups of my ...

Trying to understand FormsAuthentication
First off, I'd like to note what a great resource this site is.  I've enjoyed browsing through it during my endevors of getting a handle on ASP2.0That being said, I'm working on setting up Forms Authentication on my site.  I'm a bit confused though.  Here's my setup:  I have certian parts of this site I'd like to have open to the public, no authentication necessary.  The option to login is always  going to be in my Master page as a custom form I created that authenticates with a sql database (this is functional).  As of right now authentication just redirec...

Trying to understand NPS
I am running a Novell SBS 6.0 SP4 server with NDPS running. From the books I have been reading, NDPS printers should show up in the NWADMIN list. I have no printers, I have the broker and manager objects. I can see the printers using the TOOLS -> Public Access NDPS printers under NWADMIN. Is there something I am doing wrong? Just wondering, Ken@rlmrlm.com No, this is correct. Public Access printers are viewed in this fashion. You may be looking for Controlled Access printers which will show up in NWAdmin under the context they are created. <ken@rlmrlm.com> wro...

Trying to understand Packages
Hi I am trying to make my first package and componet in CB2009 In the Project Manager it like this: AJ_Utils.bpl Build Con..... Requires: rtl.bpi Contains: AjDrives.cpp AjDrives.cpp AjDrives.h AJ_Utils.cpp AJ_Utils.res Shouldn't there be a .bpk ? there is only a AJ_Utils.cbproj in the help it says that the package project file is caled dpk, but in builder it should be bpk right ? and when I look in the AJ_Utils.cpp what is shown below is all there is shouldn't there be something like: USEUNIT("AjDrives.cpp"); USERES(&...

Trying to understand what is this Error
I'm getting this error on my web site a bit  to often , and I have no idea why and what it is , On my local computer it has never happen , Can any one please explain what it is and where is the problem? And how I can fix it This is the Error :Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. Description: An unhandled exception occurred during the execution of the current web request. Pleas...

delphi.general Timer
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --JivePart=_202d5.zeB8CwDOH5aMJzMl Content-Type: text/plain; charset="Utf-8" For Paolo Valle --JivePart=_202d5.zeB8CwDOH5aMJzMl Content-Type: application/octet-stream; name="SubroutineTimer.pas" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="SubroutineTimer.pas" dW5pdCBTdWJyb3V0aW5lVGltZXI7DQoNCmludGVyZmFjZQ0KDQpwcm9jZWR1cmUgU3RhcnRTdWJy b3V0aW5lVGltZXI7DQpmdW5jdGlvbiBHZXRTdWJSb...

Trying to understand XML
Hi, What is the point of displaying data from XML from a database and binding it with a control when you can just connect directly to the database and then display it using a control? A friend told me it's so that the data is dynamic. Well of course it can be dynamic without XML. So what's the deal with XML (particularily from a database)? What make so special? I read that XML can be understood between different machines, like cash registers or whatever. Is this true? Thanks Hi Justin, The reason we use XML a LOT is that you cannot always connect directly to the db.  A lot f...

Trying to Understand An Error Message
Hello, I have Perl/CGI script that work fine but for the fact that it logs a message in the error log file. The message is: Use of uninitialized value in concatenation (.) or string at... Despite the message, the script does what it is supposed to do. I would like to know if this message is a harmless message or is it something that needs to be investigated and found a solution for? Thanks. Akbar Ehsan Internet Services Coordinator Central Office Ivy Tech Community College 9301 E. 59th St. Indianapolis, IN 46216 Phone: 1 317 921-4872 ----- Original Message ----- F...

Trying to understand the locking of a file
Hi again I'm trying to understand how I can check if a file is locked or not and have been using this code in order to check the FInfo info for a file #!perl -w use Mac::Files; my($file, $fileCat, $fileInfo); $file = 'Central:Desktop Folder:test.pl'; $fileCat = FSpGetCatInfo($file) or die('Bl��'); $fileInfo = $fileCat->ioFlFndrInfo() or die('Bl��'); FSpSetFLock($file); print $fileCat->ioNamePtr() . " flag: " . $fileInfo->fdFlags() . " type: " . $fileInfo->fdType() . " crea: " ....

Trying to understand this piece of code
--Next_1091445263---0-202.54.124.130-2524 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline =A0=0AHi=0A=0ACan someone please tell me what the following code is trying= to do =0A=0A=0A if ( /CR List/ .. /\(2\)/ ) {=0A if ( /CR Lis= t/ ) { print " $'\n"; }=0A elsif ( /\(2\)/ ) {print " $` \n" ;}=0A= else { print " $_\n";}=0A }=0A=0AI = know that it is trying to print whatever is there between CR List and (2). = But i am ...

trying to understand how Authentication works...
Hi dear All, I feel like I am lost in all these authentication layers, components and providers. Need help to understand it from the bottom. Here are my questions: 1) When we restrict access to files via web.config <authorization> <deny users="?" /> </authorization> what indicates to IIS that a user is authenticated or not? Is it  System.Web.HttpContext.Current.User.Identity.IsAuthenticated property? Or something else? Say, if I need to do my completely custom authentication, at the end I need just to set or reset that property? (how to reset it btw?) How authentication ticket works with all this?   2) MembershipProvider is meant to be used mainly with asp Logon control, correct? That's why if one wants to keep that standard logon control and use custom authentication, he/she just implements custom membership provider and adds it to the list of providers in web.config, right?... Hence if I do not use asp logon control, there is no much help of custom Membership Provider?   3) if MembershipProvider is used for asp logon control(s), then what FormsAuthentication is meant for? Are they on different levels of abstraction? :)   Reading of FormsAuthentication Explained gives an impression that FormsAuthentication is they key element in all this story, and Membership class is just another helper to figure out if a user can be granted those access rights...   A typical example of user authentication is t...

Trying to understand Cecil-IDs
I was an active user of this newsgroup server a couple or so years ago. Coming back, I see that it will soon be necessary to use a "Cecil-ID" to post messages. I understand how to set the user name and password in my NNTP client, but I'd like to understand the Cecil-ID itself more. Searching on Google wasn't of any help, unfortunately (although judging by what CECIL is an acronym for, this is probably an SGI (Steve Gibson Innovation)). Looking on the GRC website, I read "You choose a secret, Private Pass Phrase (of any convenient length) which is never ...

Web resources about - Trying to understand TStringDynArray - embarcadero.delphi.general

Resources last updated: 3/10/2016 5:11:05 AM