From Clomosy Docs

Revision as of 14:51, 18 September 2023 by ClomosyManager (talk | contribs) (Created page with "clPathCombine is a function that is part of the Clomosy library. This function performs the operation of combining two file paths or directory paths. In other words, when two paths are provided, this function combines them and returns the combined path as a result. The general usage is as follows: clPathCombine(FileNameString:WideString; CombinePathString:String); <span style="color:blue">''FileNameString''</span> : Searched file name. <span style="color:blue">''Com...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

clPathCombine is a function that is part of the Clomosy library. This function performs the operation of combining two file paths or directory paths. In other words, when two paths are provided, this function combines them and returns the combined path as a result.

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:

var
  strList:TclStringList;
  MyFileStr:String;
Begin
 strList := Clomosy.StringListNew;
 MyFileStr := clPathCombine('MyFile.Txt',Clomosy.AppFilesPath);
 //ShowMessage(MyFileStr);

 If clFileExists(MyFileStr,'C:\Clomosy') Then
 strList.LoadFromFile(MyFileStr,0);
 strList.Add('New Line');
 strList.SaveToFile(MyFileStr,0);
End;