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.5


Introducing the Mac OS

Getting to know the Mac OS from a programmer's viewpoint

Issue: 2.5 (May/June 2004)
Author: Owen Yamauchi
Author Bio: Owen Yamauchi is a freelance programmer who has been programming REALbasic since version F4. He is the Lead Programmer for Domain Softworx, a company that produces developer tools for REALbasic.
Article Description: No description available.
Article Length (in bytes): 11,103
Starting Page Number: 36
Article Number: 2518
Related Web Link(s):


Excerpt of article text...

In this issue, the column will focus on helping Visual Basic (VB) programmers get used to programming on the Mac. Knowing a bit about the inner workings of the system you're writing software for is very important.

Microsoft Windows and the Mac OS are fundamentally different. However, both VB and REALbasic (RB) are high-level languages; you rarely have to worry about what's going on inside. In this column, I'll cover a few basic topics that have to do with RB's interaction with the Mac OS, comparing them with VB and Windows.

In VB, you make API (Application Programming Interface) calls. These are special commands to Windows that enable your program to do something that it wouldn't normally be able to do, by calling on the operating system to do it for you. On the Mac, the idea is the same, and these commands are called Toolbox calls. The Macintosh Toolbox is the specific part of the operating system that handles these calls. The syntax for making a toolbox call is much the same in RB as in VB. At the beginning of a piece of code, you write a "Declare" statement that looks like this:

Declare Function GetCPUSpeed Lib "CarbonLib" () as Integer

Then, whenever you want to call the declared function in code, you use it like a normal function:

speed = GetCPUSpeed

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