[FR] [IT]
  [INFO] [ACQUIRE] [MAP] [RESOURCES]

Compiler


NEW FEATURES OF RELEASE 7

This document outlines the new features in FB^3 release 7.

What? A free book?
Switching to FubureBASICOne of the first things that you are going to notice is the inclusion of our new publication Switching to FutureBASIC. (Your Release 7 CD is on the inside of the back cover.) It includes information for programmers that are learning Mac OS X, the Appearance Runtime, and FutureBASIC in general.

Putting on a new face
We've got a new look! Our new icons and graphics are designed to reinforce the idea that you can let your ideas grow with FutureBASIC.


Press release:
Paris, 09/21/2002

[return to top]

Threads
For those who don't already know: threads are really cool things! You can assign a task to a thread and it will execute while other operations are under way.
FutureBASIC takes threading one step farther by creating threaded functions. Each time you call upon a threaded function it begins its assigned task without interrupting other processes. You may run several of these threaded functions at a time. When the END FN is encountered, the thread is complete and the runtime transparently shuts down everything that was used for managing that particular thread.

A thread is opened with:

THREADBEGIN FN mythreadedFunction

At some point in the function, you need to check THREADSTATUS to allow processing time for other threads. If this returns a non-zero value, then there's been a request for you to end your work in this function. You can even make multiple calls to the same threaded function and each call will produce its own asynchronous routine.


[return to top]

Help tags
Would somebody please burst the bubble on Balloon Help?
I'm switching to Mac OS X Help Tags. These very serviceable little items can appear next to buttons (or other Mac objects) to provide helpful hints to your end user.
Carbon Help Tags


[return to top]

Where angels fear to tread...
I've used low memory globals like [_time] so often in my programs that I can type them in my sleep. Big problems: if you so much as look at a low memory global in Mac OS X, your program will crash. There's no nice warning dialog; no one taps you on the shoulder and says, "Hey, don't do that." Your program just goes away.
It gets worse. You may no longer PEEK into structures (like ControlHandles) to extract information. You're supposed to use "getter" and "setter" functions from the toolbox.

Enter FutureBASIC! As your program is being compiled, we search for the use of constants that examine low memory globals or opaque structures. When an "illegal" constant is discovered, a warning is issued. (We don't actually throw you in jail for the first offense.)

Enter FutureBASIC again! Now that Apple has discarded everything that we ever worked with, what are we supposed to do?
We just pull down the Help menu and scan through the latest "Porting to Carbon" book by Alain Pastor. Alain explores all of the routines that have disappeared from your Mac's radar screen and provides alternative syntax for each of them. This manual is a "must read" for everyone jumping into the Carbon arena.


[return to top]

Resource helpers
Mac OS X brought its own set of file management problems. Many of the calls that our programs depended on suddenly ceased to exist.
Fear not! We have developed new routines that work in all supported versions of the system software (7.6 to 10.2 at the time of this writing).

DEF CREATERESFILE
USR OPENRFPERM


There have always been pitfalls in resource management. In order to correctly add or change a resource in a file you sometimes had to mix a potion containing eye of newt and a lock of hair from your mother-in-law. FutureBASIC comes to the rescue again with a foolproof routine that absolutely, positively replaces or adds a resource to a file or your money back.

USR REPLACERESOURCE

There is (and has always been) a bug in the Mac's Resource Manager that improperly sets aside disk space every time a call is made to ChangedResource. If you made a minor change to a small resource handle and made this call with each modification, the Resource Manager could have allocated space for dozens, even thousands of copies of the same resource.
Our new resource tool: DEF CHANGEDRESOURCE will first inspect a handle to see if it is a resource. If so, it will ensure that the resource has not already been tagged as changed. Only when these criteria have been met, will it actually call on the Resource Manager to make its mark.


[return to top]

UNIX
We now have access to the UNIX world through FutureBASIC. Our new OPEN "UNIX" statement lets you treat a UNIX channel as a file using standard FutureBASIC file i/o commands.
You can even run multiple unix channels simultaneously by opening each channel as you would open another file. Whether you are copying files, searching volumes, or just printing a calendar, you'll find that UNIX adds a whole new dimension to your coding.

// print a calendar for 2002

OPEN "UNIX",1,"cal 2002"
DIM a$

DO
  LINE INPUT #1,a$
  PRINT a$
UNTIL EOF(1)

CLOSE 1


Switching to FubureBASIC


[return to top]

OS X Serial
Stop talking to the walls! Granted, implementing that feature was not a simple task, but we are proud to announce the availability of serial communications in OS X. Hundreds of BASIC programs can start a new life, at last!


[return to top]

AppleScript
Have a talk with the world in AppleScript: With Release 7, you can easily build an AppleScript script on the fly right within your FutureBASIC code, then run it and get its result. You can also store the compiled script for later use. An awesome simplicity!
An example?

ROUTE _toAppleScript
PRINT "return the path to me as string"
ROUTE _toScreen

LONG IF USR APPLESCRIPTRUN(message$) = _noErr
PRINT message$
END IF

Output:
Macintosh HD:AppleScriptRun folder:FB_Temp
For a more lengthy result you would have used dataHandle = USR APPLESCRIPTGETRESULT.


[return to top]

Examples, examples, examples...
Among the bazillions of example files on the CD you can stumble on the new gems that were added for this release. You can find there demo programs that show you how to:

  • draw with Quartz 2D
  • print anti-aliased text
  • experiment with Altivec
  • upload/download files over the Internet
  • implement Drag & Drop
  • use the Time Manager
  • display dynamic Carbon help tags
  • program for OpenGL
  • exploit ".nib" files
  • access uncommon window properties like metallic background and tranparancy in OS X
  • toy with color separation
  • play music files in OS X
  • build and run AppleScript scripts from within your code
  • send UNIX commands
  • access the serial port in OS X
  • and many, many more...

  • [return to top]

    A bit of this and that
    Sure , we fixed a few bugs and tightened up a few operations. String operations are much faster than they used to be and they were already pretty fast. We've also changed the way that we create a default name for otherwise unnamed applications. We now build the file designator from the source file or project file name. We've fixed up our default about boxes and a few other things to follow Apple's human Interface Guidelines for OS X.
    We also changed our socks, so it's good news all around.

      © 2000 Pix&Mix  
      All Rights Reserved
    INFO  |  ACQUIRE  |  MAP  |  RESOURCES

      FutureBASIC is a registered trademark of Staz Software, Inc and is used with permission.