Article Preview
Buy Now
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.