From Clomosy Docs

Revision as of 10:37, 24 January 2024 by ClomosyManager (talk | contribs)

clPathCombine is a function that is part of the Clomosy library. This function returns a string data by concatenating the file path and file name.

The general usage is as follows:

clPathCombine(FileNameString:WideString; CombinePathString:String);

FileNameString : Searched file name.

CombinePathString : The file path to merge.

For instance:

CombinedPath := clPathCombine('File.txt','C:\Document');
 // Now CombinedPath will be 'C:\Document\File.txt'.

Example:

Base Syntax
 var
   strList:TclStringList;
   fileStr:String;
 begin
   strList := Clomosy.StringListNew;
   fileStr := clPathCombine('File.Txt',Clomosy.AppFilesPath);
   ShowMessage(fileStr);
 
   If clFileExists(fileStr,Clomosy.AppFilesPath) then
   begin
     strList.Add('New Line 1');
     strList.SaveToFile(fileStr,0);
   end else
   begin
     strList.SaveToFile(fileStr,0);
   end
 end;
TRObject Syntax
 var
   strList:TclStringList;
   fileStr:String;
 {
   strList = Clomosy.StringListNew;
   fileStr = clPathCombine('File.Txt',Clomosy.AppFilesPath);
   ShowMessage(fileStr);
 
   If clFileExists(fileStr,Clomosy.AppFilesPath) 
   {
     strList.Add('New Line 1');
     strList.SaveToFile(fileStr,0);
   } else
   {
     strList.SaveToFile(fileStr,0);
   }
 }

See Also