Difference between revisions of "GetFolders"

From SCAR Divi Manual
Jump to: navigation, search
(Created page with "==Definition== <source lang="scar" lines="false"> function GetFolders(Path: string): TStringArray; </source> ==Availability== SCAR Divi 3.20 > Current ==Description== This func...")
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Definition==
 
==Definition==
 
<source lang="scar" lines="false">
 
<source lang="scar" lines="false">
function GetFolders(Path: string): TStringArray;
+
function GetFolders(const Path: string): TStrArray;
 
</source>
 
</source>
  
 
==Availability==
 
==Availability==
 
SCAR Divi 3.20 > Current
 
SCAR Divi 3.20 > Current
 +
 +
===Notes===
 +
*Did not work 100% correctly until 3.39
  
 
==Description==
 
==Description==
This function generates a list of all subdirectories in a given directory specified by '''Path''' and returns it as a [[TStringArray]]. This function is not recursive.
+
This function generates a list of all subdirectories in a given directory specified by '''Path''' and returns it as a [[TStrArray]]. This function is not recursive and only returns the name of the folders without trailing path delimiter. The directory paths '.' and '..' are always amongst the results.
  
 
==Example==
 
==Example==
 
<source lang="scar">
 
<source lang="scar">
 
var
 
var
   sa: TStringArray;
+
   sa: TStrArray;
 
   i: Integer;
 
   i: Integer;
  

Latest revision as of 03:39, 2 February 2013

Definition

function GetFolders(const Path: string): TStrArray;

Availability

SCAR Divi 3.20 > Current

Notes

  • Did not work 100% correctly until 3.39

Description

This function generates a list of all subdirectories in a given directory specified by Path and returns it as a TStrArray. This function is not recursive and only returns the name of the folders without trailing path delimiter. The directory paths '.' and '..' are always amongst the results.

Example

var
  sa: TStrArray;
  i: Integer;

begin
  sa := GetFolders(IncludesPath);
  for i := Low(sa) to High(sa) do
    WriteLn(sa[i]);
end.

See Also