WriteFile

This command will write data to a file on the mobile device. String data or binary data can be written.

Group: Device Extensions


Syntax: [bOK =] Device.WriteFile(sPath, vData, bOverwrite)

bOK           (Boolean) Optional – the success or failure of the command.

sPath          (String) specifies where on the mobile device the file should be placed

vData         (Variant) contains the data to be written to the file. If it is string data it will be saved in Unicode format otherwise it will be left as is. A byte array is also allowed.

bOverwrite  (Boolean) set to True, this command will overwrite an existing file, False will return a failure because the file already existed

Example:

Dim bOK As Boolean

Dim sData As String

Dim sPath As String

sPath = "\Program Files\MyFile.txt"

sData = "Sample Text"

bOK = Device.WriteFile(sPath, sData, True)