Hi
Ok, Gamer, you asked what you're doing wrong, so I'll run through exactly what I do to attach the media to my exe's and hopefully that should help.
All my media files are kept in a single folder called 'data', which is stored in the same directory as the .dba and .dbpro files. I tend to separate things via subdirectories, such as textures, 3d, sound etc. Then when I attach the media I only attach the one directory, 'data' and use a full wild-card so every single file within 'data' in it's subdirectories is attached.
So far that's always worked fine for me. Just don't add any of the subdirectories or files, otherwise it'll attach them a second time (or worse) and make the exe larger then it should be.
Eckker, in answer to your question, it's not always easy. It really depends on a few things, mainly what data you're storing. Things like images you can change into memblocks and then just read the total memblock size to the file first (so you can recreate the memblock later) and then just stream the data from the memblock into the file directly. Then just stream the data back again when loading and create the image from the memblock. All I can really say is play around with the file and memblock commands, read from one and write to the other. Be careful as it can take some practice before you get results, and because you'll be playing with actual data files rather then just ram, start with some small files first!
Don't worry too much about reading the correct variable types from the memblock, you can just read the whole lot out as bytes and the system should be able to reconstruct it correctly as long as the data goes into the memblock in the correct order.
The great thing about this is you can put the data into the file exactly how you choose, so if you're feeling adventurous you could jumble the data up into any order you like.
The biggest problem with trying this is you get no compression what so ever, so images are effectively saved like bitmaps, so unless you come up with your own method of compressing the data, you can easily end up with huge data files, and my experience in compressing those data files hasn't been too promissing on compression ratio. Play with it, you might figure something out.
Avan
The glass is half empty...
That way there's more room for improvement!