Request: CTYPE and CARRAY

BlitzMax Forums/BlitzMax Programming/Request: CTYPE and CARRAY

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.


This is where varptr comes in which is mainly for communication with C/ASM and not for BM internally as it bypasses the GC



varptr only works on a single variable which will not work when you need a structure of variables.

A maybe a more practical example of something this might be for loading and saving of game data files.

Right now if you want to do so, you either know the combination of data sizes and read them one by one, or you read them into a bank and convert them.

It would be nice (and easier to maintain and debug) if I could do:

Struct HighScoreRecord
    Field Place%
    Field Score%
    Field Initials[3]
End Struct


Then I could do something like:
WriteBinary HighScoreRecord, sizeof(HighScoreRecord)

Obviously this is a simplistic example as well, however, I could see it being used to load and save complex Level data. Being able to read chunks of files into a Stucture like that could make the difference between long load times and fast load times.