Skip to content

WriteString

Claude edited this page Oct 26, 2026 · 5 revisions

WriteString

Command Index · BlitzBasic · Streams

WriteString stream%, string$

Works in: Blitz2D, BlitzPlus, Blitz3D

Writes a string as its length in 4 bytes followed by its text, without a line ending. Read it back with ReadString.

file = WriteFile("streams_string_example.tmp")
WriteString file, "Hello"
CloseFile file
Print FileSize("streams_string_example.tmp")
file = ReadFile("streams_string_example.tmp")
Print ReadString$(file)
CloseFile file
DeleteFile "streams_string_example.tmp"
9
Hello
Parameter Type Default Description
stream Int required The stream to write to.
string String required The text to write.

Related commands

Command Index · BlitzBasic · Streams

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally