In connection with another project of mine, I produced a
BlitzMax module that allows
writing and reading arbitrary objects to streams. It can also be seen as
a generalization of
WriteString and the rest. It should be
useful for saving game states or creating an undo feature.
It uses the reflection module for runtime information about type structures, so it needs a quite recent version of BlitzMax, I think. The zip file below contains both a module version and a simple importable version of it, plus a test program to show how it works.
Released to the public domain - feel free to use however you please.