beautypg.com

Pre-defined global values, Debugging, Mac os x – Expert Sleepers Augustus Loop v2.4.1 User Manual

Page 54: Windows

background image

Pre-defined Global Values

The system defines some values before calling your script, which you can use to make the
script’s behaviour dependent on, for example, what kind of computer you’re using. These
values (which are pretty self-explanatory) are:

isMac

isWin

isVST

isAU

isFxLoopVersion

majorVersion

minorVersion

dotVersion

version

The plug-in’s version number is of the form x.y.z (e.g. 2.1.4) where x is the major version
number, y is the minor version number, and z is the dot version. The ‘version’ global vari-
able contains a single value combining all three e.g. for version 2.1.4, ‘version’ is 20104.
This is useful for making your scripts backwardly compatible - by testing for the version
number and not trying to use features that were not present in a version of the plug-in
older than the version you’re testing for.

Debugging

You can use Lua’s ‘print’ function to write out information to help you track what’s going
on (or what’s not going on) in your script. Also any run-time errors, or errors in loading
the script in the first place, are reported. In both cases, the output goes to:

Mac OS X

The system console.log. Use the standard Console utility (located in

Applications/

Utilities

) to view it.

Windows

The system OutputDebugString API. Use an application like Sysinternal’s DebugView to
view it.