A buffer type was introduced last year, but it was limited to access by pointer. Some features have been added to make it easier and more flexible to work with buffers as placeholders for data:
- the function
cbuf copies data types to a buffer.
whereby an optional parameter can set a specific offset into the buffer:
- the routine
clbuf clears a buffer:
whereby an optional parameter can set a specific character to fill the buffer (the default is space, ascii character 32)
Manipulating buffers are important as the buffer type can be used as a record element:
Examples of buffer datatypes are in the
wiki.
The record as a user-defined type is currently being implemented. While in the process, the UDT
struc is also being revisited. The major difference between records and structures in
SharpBASIC is that records have a fixed length and cannot hold strings (not even fixed-length strings).
It's only logical.