SaveDocumentToFile
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
Return value
Name | Type |
---|---|
SaveDocumentToFile | BOOL |
Inputs
Name | Type |
---|---|
bExec | REFERENCE TO BOOL |
/ Inputs/Outputs
Name | Type |
---|---|
sFile | STRING |
Outputs
Name | Type |
---|---|
hrErrorCode | HRESULT |
Sample call:
IF bSave THEN
bSaved := fbJson.SaveDocumentToFile(sFile, bSave);
END_IF