From Clomosy Docs

FilePath : The file path where the file will be saved is specified. This typically includes a directory and a file name, such as 'C:\Users\User\Documents\cl.txt'.

FileContent : It generates the text content to be saved to the file. This can be a string value or a string data coming from an object such as TclMemo or TclEdit.

In Clomosy, the clSaveToFile procedure performs the operation of saving a file to the specified file path. This procedure saves either a string content or the data of an object to the designated file. The data is stored in the file so it can be read or used for other purposes later.

The general usage is as follows:

clSaveToFile(Clomosy.AppFilesPath+'cl.txt','Test 1');
clSaveToFile('cl.txt','Test 1');

Example
It saves the data written in a TclMemo object to the specified file directory.

var
  Form1:TclForm;
  Memo1 : TclMemo;
  Layout1 : TclLayout;
  BtnAdd : TclProButton;
void BtnAddOnClick;
{
  //ShowMessage(Clomosy.AppFilesPath);
  clSaveToFile(Clomosy.AppFilesPath+'cl.txt',Memo1.Text);
}

{
  Form1 = TclForm.Create(Self);
  
  Memo1 = Form1.AddNewMemo(Form1,'Memo1','');
  Memo1.Align = alMostTop;
  Memo1.Height = 200;
  Memo1.Width = 150;
  Memo1.Margins.Left= 10;
  Memo1.Margins.Right= 10; 
  Memo1.Margins.Top= 10;
  Memo1.TextSettings.WordWrap = True;
  
  Layout1 = Form1.AddNewLayout(Form1,'Layout1'); 
  Layout1.Align=ALTop;
  Layout1.Height = 50;
  
  BtnAdd = Form1.AddNewProButton(Layout1,'BtnAdd','');
  BtnAdd.Align = AlRight;
  BtnAdd.Margins.Right = 10;
  BtnAdd.Width = 70;  
  Form1.AddNewEvent(BtnAdd,tbeOnClick,'BtnAddOnClick');
  Form1.SetImage(BtnAdd,'https://clomosy.com/demos/add-list.png');
  
  Form1.Run;
}

See Also