Login Page - Create Account

Support Board


Date/Time: Wed, 24 Apr 2024 06:20:23 +0000



Post From: ACSIL -> Open and write into a text file....

[2020-07-17 09:02:14]
gfx2trade - Posts: 48
hi everyone,

I am quite happy with this...

void iMessageToFile(SCStudyInterfaceRef sc, SCString myText) {
  
  int FileHandle;
  int myTextLength = myText.GetLength() + 2; // +2 to count for \\
  unsigned int BytesWritten = 0;
  
  // Directory must exists
  SCString outputfile = "C:\\Trading\\Plateforme\\Log\\Sierra\\TextLogFile.txt";
  
  sc.OpenFile(outputfile, n_ACSIL::FILE_MODE_OPEN_TO_APPEND, FileHandle);
  
  myText = myText + "\r\n";
  
  sc.WriteFile(FileHandle, myText, myTextLength, &BytesWritten);


  sc.CloseFile(FileHandle);
}

hope it helps
Date Time Of Last Edit: 2020-07-17 09:03:28