Article Preview
Buy Now
COLUMN
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):
http://www.mathemaesthetics.com/
http://www.ljug.com/sw/resfool.html
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.