Serialization
The following program example demonstrates how contexts can be serialized to a file upon program startup.
Set Up File
Serialization Example: meta
using FileIO,
using Serialization.Constructs Provided through the Usings
File To Write
File Text
Formatted Serialized Text
Example Code
`Declare the relevant contexts.`
Serialized Context: context Formatted Serialized Text.
Serialized Contexts: context Formatted Serialized Text.
Serializable: contract.
App State: context
{
Should Save: bool [false];
}.
Context A [Serializable]: context
{
ValueA: int [-1];
ValueB: string ["Test"];
}.
Context B [Serializable]: context
{
ValueA: int [0];
ValueB: bool [false];
}.Last updated