SaveDocumentToFile

SaveDocumentToFile 1:

This method saves a JSON document in a file.

A rising edge at the input parameter bExec triggers the saving procedure. The asynchronous process is terminated as soon as the reference bExec is set back to FALSE from the method. When the process ends, the return value of the method indicates for one call whether saving of the file was successful (TRUE) or failed (FALSE).

Syntax

METHOD SaveDocumentToFile : BOOL
VAR_IN_OUT CONSTANT
    sFile    : STRING;
END_VAR
VAR_INPUT
    bExec    : REFERENCE TO BOOL;
END_VAR
VAR_OUTPUT
  hrErrorCode: HRESULT;
END_VAR

SaveDocumentToFile 2: Return value

Name

Type

SaveDocumentToFile

BOOL

SaveDocumentToFile 3: Inputs

Name

Type

bExec

REFERENCE TO BOOL

SaveDocumentToFile 4:/SaveDocumentToFile 5: Inputs/Outputs

Name

Type

sFile

STRING

SaveDocumentToFile 6: Outputs

Name

Type

hrErrorCode

HRESULT

Sample call:

IF bSave THEN
    bSaved := fbJson.SaveDocumentToFile(sFile, bSave);
END_IF