Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

BinaryFile.WriteText

Writes a text file with the given text.

Component Version macOS Windows Linux Server iOS SDK
BinaryFile 7.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "BinaryFile.WriteText"; BinaryFileRef; Text { ; Encoding } )   More

Parameters

Parameter Description Example Flags
BinaryFileRef The reference number for the open file. $FH
Text The text to write. "Hello World"
Encoding The text encoding for text parameter.
Default is UTF-8.
Possible encoding names: ANSI, ISO-8859-1, Latin1, Mac, Native, UTF-8, DOS, Hex, Base64 or Windows. More listed in the FAQ.
"UTF-8" Optional

Result

Returns OK or error.

Description

Writes a text file with the given text.
You have to decide which encoding to use (if not UTF-8). We support a few encodings, but we can add more if you need something special.
Please use Text.ReplaceNewline to define which line endings the file has.
If text encoding doesn't support given characters, they are converted to close match if possible or replaced by question marks.

You can pass UTF-16, UTF-16LE or UTF-16BE for encoding, too.

See also Text.WriteTextFile and Text.WriteToContainer.

Examples

Write Hello:

MBS( "BinaryFile.WriteText"; $fh; "Hello"; "UTF8")

See also

Blog Entries

This function checks for a license.

Created 12nd June 2017, last changed 12nd June 2017


BinaryFile.WriteInt - BlueThermProbe.ConnectToDevice