![]() |
Retro Rocket OS
|
The longstring library provides a MAP-backed representation of strings that may exceed the normal string size limit.
A long string is treated as an opaque handle and must only be accessed through the provided functions and procedures. Internally, data is stored as a sequence of chunks, allowing safe handling of arbitrarily large data without concatenation.
The following publicly documented procedures and functions are available via this library.
Create and return a new empty long string.
Append a normal string s$ to the end of the long string.
Data is stored as an additional chunk. No concatenation is performed.
Return the total length of the long string in characters.
This value is maintained incrementally and does not require scanning the data.
Return the number of chunks stored internally.
Return the chunk at index idx.
Returns an empty string if idx is out of range.
This function is primarily intended for streaming or debugging.
All substring operations use 0-based indexing.
These functions do not concatenate the full string; only the requested portion is constructed.
Return a substring beginning at start with maximum length length.
Return the first n characters of the long string.
Equivalent to:
Return the last n characters of the long string.
If n exceeds the total length, the entire string is returned.
Alias of FNlong_string_mid$.
Provided for naming consistency with other environments.
Search for the first occurrence of needle$ within the long string.
The search is performed safely across chunk boundaries.
Long strings are designed for streaming and partial access, not full concatenation.
Typical usage: