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 2.2

COLUMN

Use Polymorphism to Simplify Code

Issue: 2.2 (October/November 2003)
Author: Charles Yeomans
Author Bio: Charles Yeomans is a software developer in Lexington, Kentucky
Article Description: No description available.
Article Length (in bytes): 5,396
Starting Page Number: 36
Article Number: 2216
Related Web Link(s):

http://www.refactoring.com/

Excerpt of article text...

You're writing a widget server, and you'll want to implement logging. You'll want to offer several logging levels; let's say, Error, Warning, and Debug. You'll want to offer various output possibilities -- Console, log file, or no output for each logging level. Let's take a hypothetical look at how you might do that.

We'll start with a module Logger; I suggest a module because I expect that we'll want one instance only, and we'll want it always available.

Sub LogErrorMessage(message as String)

dim msgDate as Date

dim logMsg as String

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