ArrayArrayArrayArray BrainModular BrainModular Users Forum 2022-12-07T08:43:43+02:00 https://brainmodular.com/forums/app.php/feed/topic/7084 2022-12-07T08:43:43+02:00 2022-12-07T08:43:43+02:00 https://brainmodular.com/forums/viewtopic.php?t=7084&p=44569#p44569 <![CDATA[Re: get list of directory items via script]]>

CODE:

Can someone explain the meaning of 'const' in these definitions?
yes it means that you can't change it's value inside the procedure, so the procedure call is a little faster.

Statistics: Posted by senso — 07 Dec 2022, 07:43


]]>
2022-12-07T02:50:44+02:00 2022-12-07T02:50:44+02:00 https://brainmodular.com/forums/viewtopic.php?t=7084&p=44560#p44560 <![CDATA[Re: get list of directory items via script]]>
Can someone explain the meaning of 'const' in these definitions? I've never encountered it in arguments to a method before this release.

EDIT: of course, as soon as I hit send, I think of a possibility... does it mean you can't change its value in the method body??

Statistics: Posted by woodslanding — 07 Dec 2022, 01:50


]]>
2022-12-06T12:43:15+02:00 2022-12-06T12:43:15+02:00 https://brainmodular.com/forums/viewtopic.php?t=7084&p=44550#p44550 <![CDATA[Re: get list of directory items via script]]>

CODE:

  const DirectorySeparator : Char = {$IFDEF MSWINDOWS} '\'; {$ELSE} '/'; {$ENDIF}  const LineEnding = #13#10;  function  GetApplicationPath:string; //give the absolute path of the current Usine's folder  procedure FindFiles(const Directory: String; Extensions: String; Recursive: Boolean; Result: TStringList); // [Extensions] can be a comma-text  procedure FindDirectories(const Directory: String; Recursive: Boolean; Result: TStringList);   function WriteFileContents(const FileName: String; const Text: String; Append: Boolean): Boolean;  function ReadFileContents(const FileName: String): String;  function CreateDirectory(const Directory: String): Boolean;  function ForceDirectories(const Directory: String): Boolean;  function DeleteDirectory(const Directory: String; OnlyChildren: Boolean): Boolean;  function DeleteFile(const FileName: String): Boolean;  function RenameFile(const OldFileName, NewFileName: String): Boolean;  function CopyFile(const SourceFileName, DestFileName: String; Overwrite: Boolean = False): Boolean;  function FileExists(const FileName: String): Boolean;  function DirectoryExists(const Directory: String): Boolean;  function FileAge(const FileName: String): Int32; overload;  function FileAge(const FileName: String; out FileDateTime: TDateTime): Boolean; overload;  function ExtractFilePath(const FileName: String): String;  function ExtractFileDrive(const FileName: String): String;  function ExtractFileName(const FileName: String): String;  function ExtractFileExt(const FileName: String): String;  function ExtractFileDir(const FileName: String): String;  function ExpandFileName(const FileName: String): String;  function ExtractRelativePath(const BaseName, DestName: String): String;  function IncludeTrailingPathDelimiter(const Path: String) : String;  function ExcludeTrailingPathDelimiter(const Path: String): String;  function IncludeTrailingBackslash(const Path: String) : String;  function ExcludeTrailingBackslash(const Path: String): String;  function IncludeLeadingPathDelimiter(const Path : String) : String;  function ExcludeLeadingPathDelimiter(const Path: String): String;    // for compatibility  function  SubFileExt(filename:String):string;  function  PathDelim:string; // returns '/' on MACOS, '\' on windows  procedure CreateDir(dir:String);

Statistics: Posted by senso — 06 Dec 2022, 11:43


]]>
2022-12-06T03:49:17+02:00 2022-12-06T03:49:17+02:00 https://brainmodular.com/forums/viewtopic.php?t=7084&p=44544#p44544 <![CDATA[get list of directory items via script]]>
Suddenly a bigger issue, because I cannot supress the endless trace of 'file not found' messages in the beta FREE version--the page with the option to suppress is unavailable. But there are reasons I need to check for existing files, even otherwise.

In the past, I have cabled out to the file lister module and back in, but I'd love to get it inline in my scripts while I'm refactoring, it's much cleaner.

Statistics: Posted by woodslanding — 06 Dec 2022, 02:49


]]>
BrainModular BrainModular Users Forum 2022-12-07T08:43:43+02:00 https://brainmodular.com/forums/app.php/feed/topic/7084 2022-12-07T08:43:43+02:00 2022-12-07T08:43:43+02:00 https://brainmodular.com/forums/viewtopic.php?t=7084&p=44569#p44569 <![CDATA[Re: get list of directory items via script]]>

CODE:

Can someone explain the meaning of 'const' in these definitions?
yes it means that you can't change it's value inside the procedure, so the procedure call is a little faster.

Statistics: Posted by senso — 07 Dec 2022, 07:43


]]>
2022-12-07T02:50:44+02:00 2022-12-07T02:50:44+02:00 https://brainmodular.com/forums/viewtopic.php?t=7084&p=44560#p44560 <![CDATA[Re: get list of directory items via script]]>
Can someone explain the meaning of 'const' in these definitions? I've never encountered it in arguments to a method before this release.

EDIT: of course, as soon as I hit send, I think of a possibility... does it mean you can't change its value in the method body??

Statistics: Posted by woodslanding — 07 Dec 2022, 01:50


]]>
2022-12-06T12:43:15+02:00 2022-12-06T12:43:15+02:00 https://brainmodular.com/forums/viewtopic.php?t=7084&p=44550#p44550 <![CDATA[Re: get list of directory items via script]]>

CODE:

  const DirectorySeparator : Char = {$IFDEF MSWINDOWS} '\'; {$ELSE} '/'; {$ENDIF}  const LineEnding = #13#10;  function  GetApplicationPath:string; //give the absolute path of the current Usine's folder  procedure FindFiles(const Directory: String; Extensions: String; Recursive: Boolean; Result: TStringList); // [Extensions] can be a comma-text  procedure FindDirectories(const Directory: String; Recursive: Boolean; Result: TStringList);   function WriteFileContents(const FileName: String; const Text: String; Append: Boolean): Boolean;  function ReadFileContents(const FileName: String): String;  function CreateDirectory(const Directory: String): Boolean;  function ForceDirectories(const Directory: String): Boolean;  function DeleteDirectory(const Directory: String; OnlyChildren: Boolean): Boolean;  function DeleteFile(const FileName: String): Boolean;  function RenameFile(const OldFileName, NewFileName: String): Boolean;  function CopyFile(const SourceFileName, DestFileName: String; Overwrite: Boolean = False): Boolean;  function FileExists(const FileName: String): Boolean;  function DirectoryExists(const Directory: String): Boolean;  function FileAge(const FileName: String): Int32; overload;  function FileAge(const FileName: String; out FileDateTime: TDateTime): Boolean; overload;  function ExtractFilePath(const FileName: String): String;  function ExtractFileDrive(const FileName: String): String;  function ExtractFileName(const FileName: String): String;  function ExtractFileExt(const FileName: String): String;  function ExtractFileDir(const FileName: String): String;  function ExpandFileName(const FileName: String): String;  function ExtractRelativePath(const BaseName, DestName: String): String;  function IncludeTrailingPathDelimiter(const Path: String) : String;  function ExcludeTrailingPathDelimiter(const Path: String): String;  function IncludeTrailingBackslash(const Path: String) : String;  function ExcludeTrailingBackslash(const Path: String): String;  function IncludeLeadingPathDelimiter(const Path : String) : String;  function ExcludeLeadingPathDelimiter(const Path: String): String;    // for compatibility  function  SubFileExt(filename:String):string;  function  PathDelim:string; // returns '/' on MACOS, '\' on windows  procedure CreateDir(dir:String);

Statistics: Posted by senso — 06 Dec 2022, 11:43


]]>
2022-12-06T03:49:17+02:00 2022-12-06T03:49:17+02:00 https://brainmodular.com/forums/viewtopic.php?t=7084&p=44544#p44544 <![CDATA[get list of directory items via script]]>
Suddenly a bigger issue, because I cannot supress the endless trace of 'file not found' messages in the beta FREE version--the page with the option to suppress is unavailable. But there are reasons I need to check for existing files, even otherwise.

In the past, I have cabled out to the file lister module and back in, but I'd love to get it inline in my scripts while I'm refactoring, it's much cleaner.

Statistics: Posted by woodslanding — 06 Dec 2022, 02:49


]]>