From Clomosy Docs

Revision as of 06:32, 24 January 2024 by ClomosyManager (talk | contribs)

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;

See Also