// Saves the contents of the buffer into a file
// Be sure to call Open() before calling Save()
METHOD Save : SysFile.SysTypes.RTS_IEC_RESULT;
VAR_INPUT
pString : POINTER TO BYTE; // Call with ADR();
Size : UDINT; // Call with SIZEOF();
IF FileHandle <> SysFile.SysTypes.RTS_INVALID_HANDLE THEN
SysFile.SysFileWrite(hFile := FileHandle,
pbyBuffer := pString,
ulSize := Size,
pResult := ADR(Save));
END_IF