Saving a message to the text file.

 

Syntax

function Protocol(sMsg, sFileName: string; bDateTimeStamp: boolean; iEncodingType: integer): int64;

 

Parameters and return values

Parameter

Type

Value

sMsg

string

message text;

sFileName

string

full path to the log file with a name and extension;

bDateTimeStamp

boolean

add the date and time stamps to the message, if necessary.

iEncodingType

integer

file encoding type, number.

 

Function result

>=0

no errors, file file size;

1

error writing to file, error when creating a new file or the specified path is invalid.

 

Example


var
  i, iVal, iResult: int64;
begin
  iVal    := 12; // ????? ????????? ????????? ????? 12
  iResult := 1;
  
    for i := 2 to iVal do begin // ???? ?????????? ??????????
      iResult := iResult * i;
      Protocol(inttostr(i) + ' - ' + inttostr(iResult), 'c:\temp\factorial.log', true, 0);
    end;  
end.


Script work result
 

MyChat Script Engine, the result of Protocol function; computing the protocol

 

See also

IntToStr