Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview

Buy Now

Issue 8.2


Saving Data

A simple method for saving a data structure

Issue: 8.2 (January/February 2010)
Author: Marc Zeedar
Author Bio: Marc taught himself programming in high school when he bought his first computer but had no money for software. He's had fun learning ever since.
Article Description: No description available.
Article Length (in bytes): 57,444
Starting Page Number: 23
Article Number: 8210
Resource File(s):

Download Icon 8210.zip Updated: 2010-01-04 13:06:10

Related Link(s): None

Excerpt of article text...

I've written about "quick-and-dirty" programs -- apps meant for one-time use (e.g., convert uniquely formatted data to a different format) or internal use (not for public distribution or resale). These are low-value projects where you don't want to waste time thinking about the how, you just need the work done. I believe that REALbasic is an ideal platform for these kinds of projects: tasks too complicated for mere macro or scripting software, but not something that requires a Computer Science degree to write. I use a lot of this sort of apps (in fact, they are frequently used in the production of REALbasic Developer) and I've developed a number of shortcuts to make creating these apps simpler and faster, such as a library of pre-written routines and reusable classes I can just drop into my project. But one complex problem that often crops up is the saving of data.


For many programs, saving data is relatively trivial. Text in an EditField can be saved to a simple text file, or the contents of a listbox can be saved in a tab-delimitated file. Both of these tasks can easily be automated for simple reuse (for instance, it's not hard to create EditField or Listbox subclasses that know how to save and reload themselves from a file). But many programs require a slightly more complicated data structure than mere text. Even if the data itself is fairly straightforward, it may be scattered apart in different areas of your program (i.e., some in a Listbox, some in an EditField, some elsewhere), or it may simply be that you have different kinds of data (numbers and text and colors and pictures) and they can't all be easily stored in a single file.

...End of Excerpt. Please purchase the magazine to read the full article.