Hello, I’m just beginning to work with open and save.
The project has four text areas and it seems to save correctly in binary form but, when I try to open it, everything goes in the first text area.
I could not find an exhaustive explanation of opens and saves, I find the available help and documentation rather confusing for a beginner. For example: how do you behave differently if you have to save/open text, graphics or an entire window?
Is there an “all about saving/opening for dummies” help somewhere?
I’m posting a link to the piece of software (it’s an easy conversion between Julian and Gregorian dates): [url=https://www.dropbox.com/s/nqbuahbtnoiswjx/Calendari%20tst1.xojo_binary_project?dl=0]
You are saving to a binary stream
So all your output goes into one big lump.
Since what you are saving here could be text, you might have been better off using a textstream.
Each line of output would be written using
Reading it back in would then be
Anno.Text = InStream.readline
When you want to store more structured data, XMLDocument is flexible.
Images need to be turned into a text format first and converted back later.
Binary files are tricky and for large projects will nearly always frustrate you in later years.
It is up to you do define the format and structure the data in such a way that you can make sense of it when you read it back. There is no “standard” format for saving data. You must impose enough structure that you can parse it back out.