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 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 13.5 ('Text Messaging')
Instant purchase and download via GumRoad!

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):

Download Icon 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. A folderitem is a Xojo construct that represents a pointer to a file. It is not 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 returns true or false.) 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 to create 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 a BinaryStream, TextInputStream, and TextOutputStream to read and write the contents of the file.

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