Click or drag to resize
IUserAccessiableWriteFileText Method (String, String, Boolean)
This function writes the given text inText into a file created and saved on the device / PC, with the option to attach the file to the interview as an attachment. As the function is Asynchronous, when the file is actually written the callback function void OnWriteFileTextResult(String inFileName, bool inSuccess, bool inAppended)) is called and it includes the filename, success (read or not) and in this case the inAppended will be returned as false. You need to override it in your Advanced Scripts to perform what you need in case of failure.

Namespace: SurveyToGo.UserLogic.Interfaces
Assembly: UserLogicInt.Pocket (in UserLogicInt.Pocket.dll) Version: 1.0.4.0
Syntax
C#
void WriteFileText(
	string inFileName,
	string inText,
	bool inAttachToInterview
)

Parameters

inFileName
Type: SystemString
The full file path
inText
Type: SystemString
the text to write in the file
inAttachToInterview
Type: SystemBoolean
'true' to attach the file to the interview, or 'false' otherwise

Return Value

Type: 
void
Examples
WriteFileText("$ROOT$/MyTxtFile.txt", "Good morning.", true) will open the file "MyTextFile.txt" that is saved under the Root directory on the device, write "Good morning" in the file, and will attach this file to the interveiw as an attachment. If "MyTextFile" doesn't exit, it will be automatically created.
See Also