Special

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 17 in printed book and digital formats -- plus a one-year subscription (beginning with 18.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 3.6

COLUMN

File Things, Part One

Working with "folderitems"

Issue: 3.6 (July/August 2005)
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): 13,370
Starting Page Number: 32
Article Number: 3614
Related Web Link(s):

http://www.strout.net/files/rb/StringsModule.rb.zip

Excerpt of article text...

It's a rare computer program that doesn't work with files -- even the simplest projects needs to save preferences or data, or at least open a document -- but beginners are often confused by REALbasic's approach to working with files.

When I first started using REALbasic, I found folderitems bewildering. I was able to stumble through and work with them, but the process seemed complex. It took me a while to figure out why folderitems were so intimidating.

The main reason for the seeming complexity is not RB's object-oriented design -- having a file class makes complete sense -- but that RB requires two classes in order to actually open or save a file.

The concept of the folderitem class is easy to grasp: it's a simple file class that represents a file on disk and gives you the tools to create or delete a file or folder, or set various properties of that file (such as visibility).

What's confusing is that folderitems don't give you a way to actually work with the contents of a file: to read and write data. Instead, folderitems allow you to create a new kind of object -- a data stream -- that lets you manipulate the actual contents of the file.

So for the beginner, you've got to learn two new classes at once in order to work with file data. This can be confusing. I'm going to try and explain it simply.

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