Article Preview
Buy Now
COLUMN
Column
Issue: 13.5 (September/October 2015)
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): 16,253
Starting Page Number: 49
Article Number: 13506
Resource File(s):
project13506.zip Updated: 2015-09-01 11:14:17
Related Link(s): None
Excerpt of article text...
In the previous issue (
xDev 13.4), a reader asked about the proper way to save files, especially re-saves without a dialog box. This is such a basic thing for any document-based application, but the methods are often overlooked, so I thought it would be a good topic to address in this column.A Folderitem Refresher
Before we start explaining the technique, let's take a quick look at basic file usage just so that we understand the tools we're working with.
The first and most confusing thing that beginning Xojo users encounter is the concept of the
folderitem
and how that relates to files. Afolderitem
is a Xojo construct that represents a pointer to a file. It isnot the file itself. It is only an internal representation of the file.That's why a
folderitem
can point to a file that doesn't actually exist. (You can check to see if a file exists with the folderitem's.exists
method, which returnstrue
orfalse
.) You might wonder why you need the ability to refer to non-existant files and the answer is simple: without it, there'd be no way tocreate a new file !Since a
folderitem
, by itself, cannot actually see the contents of the file, you have to use other Xojo objects, such as aBinaryStream
,TextInputStream
, andTextOutputStream
to read and write the contents of the file.
...End of Excerpt. Please purchase the magazine to read the full article.