Objective-Basic's Language Reference

Objective-Basic comes with extensive documentation, with hypertext cross-references throughout, so you can easily click your way to whatever interests you. The part of the documentation that you will probably use the most is the this Language Reference. Each link provides a different way of navigating the this Language Reference; try them all to see which work best for you. Objective-Basic ships with lots of small and some medium-sized example programs that teach you how to implement various tasks. Most of them will show how to use a certain class or module, others aim at programming techniques and basics, and some of them simply want to show you what is possible.

Names starting with 'NS' normally directly points to native Cocoa names in general. If you would like to send a comment or an example, please write to mailto:sales@objective-basic.com.
This new framework provides many improvements and enhancements over previous releases. This overview covers the most important features. Objective-Basic will be continuously improved as a result of feedback and suggestions from customers and the open source community.

Last edit on 2012-03-26 16:33:34

Subs & Functions

Sub-procedures contain commands and statements, but do not return a value or cannot be used in expressions. The following built-in subs are predefined subs, which has a special meaning and which meaning cannot be changed. Some of them are provided for VB6 backward compatibility.A function-procedure is like a sub-procedure, but it can return a value. That is the only difference between them. The following built-in functions are predefined functions, which has a special meaning and which meaning cannot be changed. Some of them are provided for VB6 backward compatibility.

Abs Alert AlertPanel Append Asc At Atn Bash BeginAlertSheet BeginDrawer BeginExpanding BeginModal BeginSheet BitClr BitSet BitTst CBool CByte CDbl CInt CLng CShort CSng Character Chr ClassName Clone Compare ConcatWithSpaces Contains ContainsRect Cos Count CriticalAlertPanel DoRunLoop EndDrawer EndExpanding EndModal EndSheet EndsWith Exp Fact FileExtension FileName FilePath Finder Fix Format FormatDecimal FormatFloat Hex InStr InStrRev IndexOf Info InputPanel InsetRect Int IntersectionRect IntersectsRect IsArray IsBoolean IsByte IsData IsDouble IsEmptyRect IsEqualClass IsEqualObject IsEqualValue IsFloat IsInt16 IsInt32 IsInt64 IsInt8 IsInteger IsMac32Bit IsMac64Bit IsNumber IsPoint IsRange IsRect IsShort IsSingle IsSize IsString IsValue Join LCase LastIndexOf Launch Left Len Length Ln Log10 Lower Max Min MsgBox Nz OffsetRect PointInRect Preferences Prepend Preview RND Random Randomize ReadArray ReadDictionary ReadString Replace Reversed Right Round Run Safari ScreenRect Sin Space Split Sqr StartsWith Str StrReverse Tan TextEdit Trace Trim Trimmed UCase Unicode UnionRect Upper WriteArray WriteDictionary WriteString arch plist

The following list contains the init functions.

Array BevelButton Boolean Byte CheckBox CircularProgressIncicator CircularSlider CustomView Data Dictionary DisclosureButton DisclosureTriangle Double Float GradientButton HelpButton HorizontalLine HorizontalSplitView IndeterminateProgressIncicator Integer Label Long MovieView NSActionCell NSAlert NSApplication NSArray NSArrayController NSAttributedString NSBox NSButton NSButtonCell NSCell NSColor NSColorWell NSComboBox NSControl NSController NSCursor NSData NSDatePicker NSDictionary NSDictionaryController NSDrawer NSFileManager NSFont NSImage NSImageCell NSImageView NSLevelIndicator NSMatrix NSMenu NSMenuItem NSMenuItemCell NSMutableArray NSMutableAttributedString NSMutableData NSMutableDictionary NSMutableString NSNotification NSObject NSObjectController NSPanel NSPopUpButton NSPopUpButtonCell NSProgressIndicator NSResponder NSScrollView NSSearchField NSSecureTextField NSSegmentedControl NSSlider NSSplitView NSStepper NSString NSTabView NSTableColumn NSTableView NSTask NSText NSTextField NSTextView NSThread NSTimer NSToolbar NSToolbarItem NSTreeController NSUserDefaultsController NSView NSViewController NSWindow NSWindowController OBBackgroundView OBPreferences OBTask OBTextView Point PushButton RadioButton Range RecessedButton Rect RoundButton RoundedRectButton RoundedTexturedButton Short Single Size SquareButton String TexturedButton VerticalLine VerticalSplitView id

Objects

The following list contains the built-in objects.

AppDelegate CMath Debug File FirstResponder NSBundle NSNotificationCenter NSOpenPanel NSProcessInfo NSSavePanel NSUserDefaults User

Classes

Classes are needed, when you would like create objects. The following list contains the built-in classes.

MovieView NSActionCell NSAlert NSApplication NSArray NSArrayController NSAttributedString NSBox NSButton NSButtonCell NSCell NSColor NSColorWell NSComboBox NSControl NSController NSCursor NSData NSDatePicker NSDictionary NSDictionaryController NSDrawer NSEvent NSFileManager NSFont NSImage NSImageCell NSImageView NSLevelIndicator NSMatrix NSMenu NSMenuItem NSMenuItemCell NSMutableArray NSMutableAttributedString NSMutableData NSMutableDictionary NSMutableString NSNotification NSObject NSObjectController NSPanel NSPopUpButton NSPopUpButtonCell NSProgressIndicator NSResponder NSScrollView NSSearchField NSSecureTextField NSSegmentedControl NSSlider NSSplitView NSStepper NSString NSTabView NSTableColumn NSTableView NSTask NSText NSTextField NSTextView NSThread NSTimer NSToolbar NSToolbarItem NSTreeController NSUserDefaultsController NSView NSViewController NSWindow NSWindowController

Inheritance Tree

Built-in Cocoa classes are listed. NSObject is the root class of most classes. Through id, objects inherit a basic interface to the runtime system.


Non NSObject-based classes



Controls and Objective-Basic classes

There are provided to get abbreviations for common Cocoa classes and features. They are not known to Xcode/Interface Builder, because they are actually created using functions from real classes above.



Keywords

A keyword is a predefined identifier, which has a special meaning for Objective-Basic and which meaning cannot be changed. The following list contains all Objective-Basic keywords. Be aware that keywords are case sensitive, which means you must it write with the same lowercase or uppercase letters everywhere. Some of them are provided for backward compatibility.

</string> <string> Action Alias As AsRef Break ByRef ByVal Call Case Catch Class Const Continue Declare Delegate Dim Do Else End Enum Event Exception Exit False Finally For Framework Function Global GoTo IBAction IBOutlet IIf If Is Iterate Loop Me Mid Module Next Nil No Null Private Property Public Return Select Static Step Sub Super SuperClass Then Then To True Try Until Var While Yes

Types

Like a file, a variable has a name (used to access the variable and to identify it). Additional, it has also a data type to specify the type of information a variable holds. So data types describe the type of data stored inside a variable. If you declare a variable you must also give it a data type. Unlike built-in classes, the following types cannot be used as super class for custom classes.

Array Boolean Byte Data Dictionary Double Float Integer Long Point Range Rect Short Single Size String id

Constants

Constants are similar to variables but they cannot change values. When you declare a constant you assign a value to it that cannot be altered during the lifetime of your program.

ArrowCursor BlackColor BlueColor BrownColor CaseInsensitive CaseSensitive ClearColor ClosedHandCursor CrosshairCursor CurrentCursor CyanColor DarkGrayColor DisappearingItemCursor GrayColor GreenColor IBeamCursor LightGrayColor MagentaColor NSAlertFirstButtonReturn NSAlertSecondButtonReturn NSAlertThirdButtonReturn NSAlternateKeyMask NSBezelBorder NSBorderlessWindowMask NSBoxCustom NSBoxOldStyle NSBoxPrimary NSBoxSecondary NSBoxSeparator NSCenterTextAlignment NSCircularBezelStyle NSClosableWindowMask NSCommandKeyMask NSControlKeyMask NSDisclosureBezelStyle NSDownArrowFunctionKey NSFocusRingTypeDefault NSFocusRingTypeExterior NSFocusRingTypeNone NSGrooveBorder NSHelpButtonBezelStyle NSHighlightModeMatrix NSImageAbove NSImageBelow NSImageLeft NSImageOnly NSImageOverlaps NSImageRight NSJustifiedTextAlignment NSLeftArrowFunctionKey NSLeftTextAlignment NSLineBorder NSListModeMatrix NSMiniaturizableWindowMask NSMixedState NSMomentaryChangeButton NSMomentaryLight NSMomentaryLightButton NSMomentaryPushButton NSMomentaryPushInButton NSNaturalTextAlignment NSNoBorder NSNoImage NSOffState NSOnOffButton NSOnState NSOrderedAscending NSOrderedDescending NSOrderedSame NSPushOnPushOffButton NSRadioButton NSRadioModeMatrix NSRecessedBezelStyle NSRegularSquareBezelStyle NSResizableWindowMask NSRightArrowFunctionKey NSRightTextAlignment NSRoundRectBezelStyle NSRoundedBezelStyle NSRoundedDisclosureBezelStyle NSScaleNone NSScaleProportionally NSScaleToFit NSShadowlessSquareBezelStyle NSShiftKeyMask NSSmallSquareBezelStyle NSSwitchButton NSTableColumnAutoresizingMask NSTableColumnNoResizing NSTableColumnUserResizingMask NSTableViewGridNone NSTableViewSolidHorizontalGridLineMask NSTableViewSolidVerticalGridLineMask NSTextFieldRoundedBezel NSTextFieldSquareBezel NSTexturedBackgroundWindowMask NSTexturedRoundedBezelStyle NSTexturedSquareBezelStyle NSThickSquareBezelStyle NSThickerSquareBezelStyle NSTitledWindowMask NSToggleButton NSToolbarCustomizeToolbarItemIdentifier NSToolbarDisplayModeDefault NSToolbarDisplayModeIconAndLabel NSToolbarDisplayModeIconOnly NSToolbarDisplayModeLabelOnly NSToolbarFlexibleSpaceItemIdentifier NSToolbarSeparatorItemIdentifier NSToolbarSizeModeDefault NSToolbarSizeModeRegular NSToolbarSizeModeSmall NSToolbarSpaceItemIdentifier NSTrackModeMatrix NSUpArrowFunctionKey NSViewHeightSizable NSViewMaxXMargin NSViewMaxYMargin NSViewMinXMargin NSViewMinYMargin NSViewNotSizable NSViewWidthSizable OpenHandCursor OrangeColor PointingHandCursor PurpleColor RedColor ResizeDownCursor ResizeLeftCursor ResizeLeftRightCursor ResizeRightCursor ResizeUpCursor ResizeUpDownCursor WhiteColor YellowColor

Operators

Operators for calculating, comparision, logical operators and other Operators.

! $ & ' ( ) * + - . / : <= <> = = == === >= And AndAlso Flip Mod Not Or OrElse Shl Shr Xor \ ^

Operator Order

Normally, an expression is executed from left to right following standard mathematical rules. Here is the overview about operator order (priority) from top to bottom, which means * is executed before And:

  1. . ! ( )
  2. Not Flip (unary +) (unary -)
  3. * / \ Mod
  4. & + -
  5. ^
  6. Shl Shr
  7. < > < = >= = == ===
  8. And
  9. Or Xor
  10. AndAlso
  11. OrElse

Use paranthesis () to change the order.

Sub-Classing

Most built-in Cocoa classes may be used to create new classes (a sub-class) based on an existing Cocoa class. Change the file extension of a code file in order to do so.

Example: file name is 'Car.NSObject'.

Class name is 'Car' and super class is 'NSObject' (the file extension).

Control Flow & Structure

Decisions: The term 'decisions' refers to the use of conditional statements to decide what to execute in your program. Conditional statements test if a given expression is 'True' or 'False.'Then, statements are executed. Normally a condition uses an expression in which a comparison operator is used to compare two values or variables.

Loops: The statements that control decisions and loops are called control structures. Normally every command is executed only one time but in many cases it may be useful to run a command several times until a defined state has been reached. Loops repeat commands depending upon a condition. Some loops repeat commands while a condition is 'True,' other loops repeat commands while a condition is 'False.' There are other loops repeating a fixed number of times and some repeat for all elements of a collection.

Class : Classes are needed, when you would like use custom objects.

Module : Modules are needed, when you would like to organize large code parts

Do...Loop Until : repeats until a condition is set

Do...Loop While : repeats statements while condition is set

Do Until...Loop : A group of statements enabling you to define a loop which will be repeated until a certain condition remains true.

Do While...Loop : A group of statements enabling you to define a loop which will be repeated until a certain condition remains true.

Break : breaks out of a loop wether it is a for loop or not

Exit Do : breaks out of a loop

Exit For : breaks out of a for loop

Exit Function : exits a function

Exit Sub : exits a sub

For Next : Defines a loop that runs for a specified number of times.

GoTo : jumps to the desired label or line

If : single decision possibility

IIf : returns a value depending on an expression

Continue : continues to iterate a loop wether it is a for loop or not

Iterate Do : continues to iterate a loop if condition is set

Iterate For : continues to iterate a for loop if condition is set

Return : returns either from a gosub call or leaves the function or sub

Select : Multi-line conditional selection statement.

While...End While : A group of statements enabling you to define a loop which will be repeated until a certain condition remains true.

Comments

The ÿ symbol ' is used to mark comments in code. Comments can explain a procedure or a statement. Objective-Basic ignores all comments while compiling and running your program. To write a comment, use the symbol ' followed by the text of the comment. Comments are printed in green on screen. Comments are extremely helpful when it comes to explaining your code to other programmers. So comments, normally, describe how your program works.

* ' Code is recognized as comment till the end of the current line.



Literals

Besides keywords, symbols, and names, a Objective-Basic program contains literals. A literal is a number or string representing a value. There are different numerical literals.
Byte, Short, Integer, Long-1, 2, -44, 4453
Single21.32, 0.344, -435.235421.21
Double212.23
StringIs simply text, but it must start with a " and end with a " so that Objective-Basic can recognize it as string. Strings uses the same escape codes as Objective-C strings. Important escape codes are: \" = Double quotation mark, \\ = Backslash
BooleanYes, No



Appendix: Way of naming

When coding in Objective-Basic, you declare and name elements, like procedures (functions and subs), variables, and constants and so on. All names must start with a letter; may contain letters, numbers, or the sign _ (periods and commas are forbidden); and must not contain reserved words. A reserved word is a part of Objective-Basic and has a predefined meaning. These include keywords (e.g. If or Then), builtin-functions and operators (e.g. Mod). Be aware that names are case sensitive, which means you must it write with the same lowercase or uppercase letters everywhere.

Appendix: List of Objective-C Keywords

The following list contains all Objective-C keywords, which must not be used in Objective-Basic code.

alloc auto autorelease bool break bycopy byref case char const continue default do double else enum extern float for goto if in inout int long oneway operator out register release retain return self short signed sizeof static struct super switch typedef union unsigned void volatile while


Appendix: Syntax of Arguments

The following list gives you some hints regarding how to read the syntax provided here.

Arguments listed inside brackets [ ] are optional.
(Do not write these [ ] in your code).

{ } together with | means that one of the elements must be written.
(Do not write these { } or | in your code).



























































































Subs & Functions

Function Abs(Argument As Float) As Float

Abs(...) returns the absolute value of the given argument.

See also Atn

Sub Alert(Title As id [, Message As id])

Alert(...) shows a message on the screen. It is either is a small modal window with a title and a message or just a message only. Very useful for showing information to the user or to debug during application development.

See also InputBox, BeginAlertSheet
Alias MsgBox

Function AlertPanel(Title As String, Message As String [, DefaultButton As String [, AlternateButton As String [, OtherButton As String]]]) As Integer

AlertPanel(...) displays a small modal window, with optionally up to three buttons the user may select. Returns one of the following values: NSAlertDefaultReturn, NSAlertAlternateReturn or NSAlertOtherReturn.

Function Append(Argument As String, Append As String) As String

Append(...) returns a new string as a combination of both given strings.

Function Array(
| no arguments
) As Array

Creates and returns a new object based on the class 'Array'.
Or creates and returns a new object of type 'Array'.

Function Asc(Argument As String [, Index As Integer]) As Integer

Asc(...) returns the unicode integer value of an character at the given position inside a string.

See also Chr
Alias Unicode

Function At(Argument As String, Index As Integer) As String

At(...) returns a single character from a given string as a string with the length 1 starting at the specified index argument.

Function Atn(Argument As Float) As Float

Atn(...) returns the principal arc tangent of x, in the interval [-pi/2,+pi/2] radians.

See also Atn

Function Bash(FilePathOrCode As String [, Arguments As Array]) As String

Returns data from stdout and stderr of bash execution. Only executable files are executed by bash. Use the terminal command 'chmod 555 filename' to make it executable.

Sub BeginAlertSheet(Title As String, Message As String, [Context As String [, DefaultButton As String [, AlternateButton As String [, OtherButton As String]]]])

BeginAlertSheet(...) shows a customized alert sheet and must be used together with EndAlertSheet(...).code>Event AwakeFromNib() BeginAlertSheet("hallo", "Welt", "fileerror", "1", "2", "3")' if there is no key window, the alert sheet will be visible as normalwindowEnd EventDelegate EndAlertSheet(alert As NSAlert, returnCode As Integer, contextInfo As NSString)'Alert(Context, ReturnCode) Select contextInfo Case "fileerror" Select returnCode Case NSAlertFirstButtonReturn Alert("1") Case NSAlertSecondButtonReturn Alert("2") Case NSAlertThirdButtonReturn Alert("3") End SelectEnd SelectEnd Delegate

Sub BeginDrawer(Argument As NSDrawer)

BeginDrawer(...) is useful to handle NSDrawer objects. See the NSDrawer example for details.

See also EndDrawer

Sub BeginExpanding(Show As NSView, theWindow As NSWindow)


Function BeginModal(Argument As NSWindow) As Integer

BeginModal(...) is useful to handle modal windows. See the Modal example for details.

Sub BeginSheet(Argument As NSWindow, [Context As String])

BeginSheet(...) displays a customized sheet. See the Sheet example for details.

Function BevelButton() As BevelButton

Creates and returns a new object based on the class 'BevelButton'.

Function BitClr(Value As Integer, Position As Integer) As Integer

BitClr(...) lets you set a single bit of an integer value to 0.

Function BitSet(Value As Integer, Position As Integer) As Integer

BitSet(...) lets you set a single bit of an integer value to 1.

Function BitTst(Value As Integer, Position As Integer) As Integer

BitTst(...) lets you retrieve a single bit of an integer value.

Function Boolean(Expression As id, Locale As Boolean = False
| no arguments) As Boolean

Tries to convert an expression to a boolean. Locale is ignored for now.
Or creates and returns a new object of type 'Boolean'.

Alias CBool

Function Byte() As Byte

Creates and returns a new object of type 'Byte'.

Function CBool(Expression As id, Locale As Boolean = False) As Boolean

Tries to convert an expression to a boolean. Locale is ignored for now.

Alias Boolean

Function CByte(Expression As id, Locale As Boolean = False) As Integer

Tries to convert an expression to an integer type. This will remove any precision from a float value. Locale is ignored for now.

Alias CInt, CLng, CShort, Integer

Function CDbl(Expression As id, Locale As Boolean = False) As Float

Tries to convert an expression to a Float. Locale is ignored for now.

See also CSng, CInt, CLng
Alias CSng, Float

Function CInt(Expression As id, Locale As Boolean = False) As Integer

Tries to convert an expression to an integer type. This will remove any precision from a float value. Locale is ignored for now.

Alias CByte, CLng, CShort, Integer

Function CLng(Expression As id, Locale As Boolean = False) As Integer

Tries to convert an expression to an integer type. This will remove any precision from a float value. Locale is ignored for now.

Alias CByte, CInt, CShort, Integer

Function CShort(Expression As id, Locale As Boolean = False) As Integer

Tries to convert an expression to an integer type. This will remove any precision from a float value. Locale is ignored for now.

Alias CByte, CInt, CLng, Integer

Function CSng(Expression As id, Locale As Boolean = False) As Float

Tries to convert an expression to a Float. Locale is ignored for now.

See also CSng, CInt, CLng
Alias CDbl, Float

Function Character(Argument As Integer) As String

Character(...) returns a unicode character as string for a given integer unicode value. (Or returns the ASCII character corresponding to the value of Val. Argument must be a numerical expression.)

See also Asc
Alias Chr

Function CheckBox() As CheckBox

Creates and returns a new object based on the class 'CheckBox'.

Function Chr(Argument As Integer) As String

Chr(...) returns a unicode character as string for a given integer unicode value. (Or returns the ASCII character corresponding to the value of Val. Argument must be a numerical expression.)

See also Asc
Alias Character

Function CircularProgressIncicator() As CircularProgressIncicator

Creates and returns a new object based on the class 'CircularProgressIncicator'.

Function CircularSlider() As CircularSlider

Creates and returns a new object based on the class 'CircularSlider'.

Function ClassName(Expression As id) As String


Function Clone(anObject As id) As id


Function Compare(Argument As String, Compare As String, CaseSensitive As Boolean = True) As Integer

Compare(...) lexically compares this string with the other string and returns an integer less than, equal to, or greater than zero if this string is less than, equal to, or greater than the other string.

Function ConcatWithSpaces(Argument As id [, ...]) As String

ConcatWithSpaces(...) lets you join two or more strings.

Function Contains(Argument As String, Search As String, CaseSensitive As Boolean = True) As Boolean

Contains(...) finds out if a given string is inside another string. Returns true if this Argument string contains an occurrence of the string Search; otherwise returns false.

Function ContainsRect(Argument As Rect, IsIn As Rect) As Boolean

ContainsRect(...) returns 'Yes' if the first Rect contains the other.

Function Cos(Argument As Float) As Float

Cos(...) returns the cosine of the argument in radians.

Const PI = 3.141592654
Print Atn(Tan(PI / 4.0)), PI / 4.0 ' result: .7853981635 .7853981635
Print(Cos(180 *(PI / 180))) ' result: -1
Print(Sin(90 *(PI / 180))) ' result: 1
Print(Tan(45 *(PI / 180))) ' result: 1.000000000205103


Function Count(Argument As String, Search As String, CaseSensitive As Boolean = True) As Integer

Count(...) finds out how often a given string is inside another string.

Function CriticalAlertPanel(Title As String, Message As String [, DefaultButton As String [, AlternateButton As String [, OtherButton As String]]]) As Integer

CriticalAlertPanel(...) displays up a small modal window, with optionally up to three buttons the user may select. Unlike AlertPanel(...) it also shows a critical icon image on that window. Returns one of following values: NSAlertDefaultReturn, NSAlertAlternateReturn or NSAlertOtherReturn.


Function CustomView() As CustomView

Creates and returns a new object based on the class 'CustomView'.

Function Data(
| no arguments
) As Data

Creates and returns a new object based on the class 'Data'.
Or creates and returns a new object of type 'Data'.

Function Dictionary(
| Key As String := Value As id [, ...] | Keys As List, Values As List) As Dictionary

Creates and returns a new object based on the class 'Dictionary'.
Or creates and returns a new object of type 'Dictionary'. Up to 20 arguments may be used to initialize the dictionary.

Function DisclosureButton() As DisclosureButton

Creates and returns a new object based on the class 'DisclosureButton'.

Function DisclosureTriangle() As DisclosureTriangle

Creates and returns a new object based on the class 'DisclosureTriangle'.

Sub DoRunLoop(TimeInterval As Double)

DoRunLoop() uses the Cocoa class NSRunLoop to process input source like mouse events or paint events. It is similar to DoEvents() in VB6.
The Cocoa documentation says that mouse and keyboard events, NSPort objects, and NSConnection objects as well NSTimer events are processed.
Runs the hidden event processing loop of your application for a number of seconds. If your program does heavy calculation within a loop and your application needs to be responsive to the user, call it often within the loop.

Function Double() As Double

Creates and returns a new object of type 'Double'.

Sub EndDrawer(Argument As NSDrawer)

EndDrawer(...) is useful to handle NSDrawer objects. See the NSDrawer example for details.

See also BeginDrawer

Sub EndExpanding(Hide As NSView, theWindow As NSWindow)


See also BeginExpanding

Sub EndModal([ReturnCode As Integer])

EndModal(...) is useful to handle modal windows. See the Modal example for details.

See also BeginModal

Sub EndSheet(Argument As NSWindow, [ReturnCode As Integer])

EndSheet(...) is useful to handle sheets. See the Sheet example for details.

See also BeginSheet

Function EndsWith(Argument As String, Search As String, CaseSensitive As Boolean = True) As Boolean

EndsWith(...) finds out if a given string ends with another string. Returns true if the string Argument ends with Search; otherwise returns false.

Function Exp(Argument As Float) As Float

Exp(...) returns the base-e exponential function of x, which is the e number raised to the power x.

MsgBox(Exp(0), Exp(1)) ' result: 1 2.718282
MsgBox(Log10(1), Log10(Exp(1))) ' result: 0 1


See also Log10

Function Fact(Argument As Float) As Float

Fact(...) is implemented as follows:

Function test()
Dim x As Float
Dim y As Float

y = 1
For x = 1 To argument
y = y * x
Next
Return y
End Function


Function FileExtension(Argument As String) As String

FileExtension(...) returns the name of the file extension of a given string, which is expected to contain a file name.

Function FileName(Argument As String) As String

FileName(...) is useful if you have to deal with filename in a string. It returns only the parts of the string, which are the name of the file name of a given string leaving out the full path.

Function FilePath(Argument As String) As String

FilePath(...) returns the path information of a given string, which is expected to contain a path with a file name.

Sub Finder(FilePath As String)

Finder(...) shows up a Mac OS X Finder window listening the directory given as the argument.

Function Fix(Argument As Float) As Integer

Fix(...) removes the fraction part of a real number and returns the Integer portion only.

MsgBox(Fix(12.49), Fix(12.54)) ' both results are : 12


See also Int, CInt, CLng

Function Float(Expression As id, Locale As Boolean = False
| no arguments) As Float

Tries to convert an expression to a Float. Locale is ignored for now.
Or creates and returns a new object of type 'Float'.

See also CSng, CInt, CLng
Alias CDbl, CSng

Function Format(Argument As id, Locale As Boolean = False) As String

Format(...) returns a value as string formatted. The argument is usally a number. It is useful for formatting numbers. Locale is ignored for now.

Function FormatDecimal(Argument As Double [, Locale As Boolean = No [, DecimalPlaceLength As Integer = 2]]) As String

Rounds decimal place (5 - 9 round up, else no round up)

Function FormatFloat(Argument As Float, Locale As Boolean = False, DecimalPlaceLength As Integer = 2) As String

Rounds decimal place (5 - 9 round up, else no round up). Locale and DecimalPlaceLength is ignored for now.

Function GradientButton() As GradientButton

Creates and returns a new object based on the class 'GradientButton'.

Function HelpButton() As HelpButton

Creates and returns a new object based on the class 'HelpButton'.

Function Hex(Argument As Integer) As String

Hex(...) returns a string representing a long value as hexadecimal.

' Characters of Hex (0 - 9, A - F)
'
' Hexadecimal -> Decimal
' 0 -> 0
' 1 -> 1
' 2 -> 2
' 3 -> 3
' 4 -> 4
' 5 -> 5
' 6 -> 6
' 7 -> 7
' 8 -> 8
' 9 -> 9
' A -> 10
' B -> 11
' C -> 12
' D -> 13
' E -> 14
' F -> 15
' 10 -> 16
Dim v = InputBox("Please type in a number: ")
MsgBox("The hexadecimal representation is ", Hex(v))


Function HorizontalLine() As HorizontalLine

Creates and returns a new object based on the class 'HorizontalLine'.

Function HorizontalSplitView() As HorizontalSplitView

Creates and returns a new object based on the class 'HorizontalSplitView'.

Function InStr(Argument As String, Search As String, Index As Integer = 0, CaseSensitive As Boolean = True) As Integer

InStr(...) returns the position of the first occurrence of a given string inside another string starting from the beginning. It returns -1, if the string could not be found. First position in Source is referenced as 0.

Dim s As String

s = "Bernd Noetscher's Q7Basic"
MsgBox("string position = " & InStr(1, s, "Q7Basic"))


Alias IndexOf

Function InStrRev(Argument As String, Search As String, Index As Integer = -1, CaseSensitive As Boolean = True) As Integer

InStrRev(...) returns the position of the first occurrence a given string inside another string starting from the end. It returns -1, if the string could not be found.

Dim x As String, y As String

x = "This is a string"
y = "s"

MsgBox(InStRev(x, y))


Alias LastIndexOf

Function IndeterminateProgressIncicator() As IndeterminateProgressIncicator

Creates and returns a new object based on the class 'IndeterminateProgressIncicator'.

Function IndexOf(Argument As String, Search As String, Index As Integer = 0, CaseSensitive As Boolean = True) As Integer

IndexOf(...) returns the position of the first occurrence of a given string inside another string starting from the beginning. It returns -1, if the string could not be found. First position in Source is referenced as 0.

Dim s As String

s = "Bernd Noetscher's Q7Basic"
MsgBox("string position = " & InStr(1, s, "Q7Basic"))


Alias InStr

Function Info(Expression As id) As String

Info(...) returns the description of every object Cocoa provides. It is often really helpful to get information about objects during development, because it often shows the value of complex objects like Array.

Function InputPanel(MessageText As String, InformativeText As String, InputText As String) As String

InputPanel() is a simple way to let the user input a value asked in a small modal window.
Known limitations: The input field does not automatically get the keyboard input focus yet.
For a more sophisticated window with many custom GUI controls, create a window with Xcode..

Function InsetRect(Argument As Rect, OffsetX As Integer, OffsetY As Integer) As Rect

InsetRect(...) returns a contracted or expanded version of Rect depending upon the sign (+/-) of the X and/or arguments...

Function Int(Argument As Float) As Float

Int(...) returns the largest integer value that is not greater than the given argument (returns the next integer number <= given number).

Dim n As Integer

n = Int(12.54)
MsgBox(n)

n = Int( - 99.4)
MsgBox(n)


See also Fix, CInt

Function Integer(Expression As id, Locale As Boolean = False
| no arguments) As Integer

Tries to convert an expression to an integer type. This will remove any precision from a float value. Locale is ignored for now.
Or creates and returns a new object of type 'Integer'.

Alias CByte, CInt, CLng, CShort

Function IntersectionRect(Argument As Rect, OtherRect As Rect) As Rect

IntersectionRect(...) returns a rect containing the common area between two rects.

Function IntersectsRect(Argument As Rect, OtherRect As Rect) As Boolean

IntersectsRect(...) returns 'Yes' if the rects at least partially overlap.

Function IsArray(Argument As id) As Boolean

Returns a Boolean value that indicates whether the given object is an Array object (or NSMutableArray). NSArray returns 'No'.

Function IsBoolean(Argument As id) As Boolean

Returns true if a variable represents a boolean type

Dim x As Boolean

Print IsBoolean(x)


Function IsByte(Argument As id) As Boolean

Returns true if a variable represents an integer (Byte, Short...) type.


Dim i As Byte
Dim x As String

Print IsByte(i)
Print IsByte(x)
Dim x As Boolean

Print IsBoolean(x)


Alias IsInt16, IsInt32, IsInt64, IsInt8, IsShort, IsInteger

Function IsData(Argument As id) As Boolean

Returns a Boolean value that indicates whether the given object is a Data object (or NSMutableData). NSData returns 'No'.

Function IsDouble(Argument As id) As Boolean

Returns true if a variable represents a float type.

Dim i As Float
Dim x As String

Print IsFloat(i)
Print IsFloat(x)


Alias IsSingle, IsFloat

Function IsEmptyRect(Argument As Rect) As Boolean

IsEmptyRect(...) returns 'Yes' if the rect empty (no area).

Function IsEqualClass(Argument As id, 2ndArgument As id) As Boolean

Returns a Boolean '''value''' that indicates both objects are of the same class type.

See also IsEqualObject, IsEqualValue

Function IsEqualObject(Argument As id, 2ndArgument As id) As Boolean

Returns a Boolean '''value''' that indicates whether both objects are equal.

See also IsEqualClass, IsEqualValue

Function IsEqualValue(Argument As id, 2ndArgument As id) As Boolean

Returns a Boolean value that indicates whether both objects variables point to the same object.

See also IsEqualClass, IsEqualObject

Function IsFloat(Argument As id) As Boolean

Returns true if a variable represents a float type.

Dim i As Float
Dim x As String

Print IsFloat(i)
Print IsFloat(x)


Alias IsDouble, IsSingle

Function IsInt16(Argument As id) As Boolean

Returns true if a variable represents an integer (Byte, Short...) type.


Dim i As Byte
Dim x As String

Print IsByte(i)
Print IsByte(x)
Dim x As Boolean

Print IsBoolean(x)


Alias IsByte, IsInt32, IsInt64, IsInt8, IsShort, IsInteger

Function IsInt32(Argument As id) As Boolean

Returns true if a variable represents an integer (Byte, Short...) type.


Dim i As Byte
Dim x As String

Print IsByte(i)
Print IsByte(x)
Dim x As Boolean

Print IsBoolean(x)


Alias IsByte, IsInt16, IsInt64, IsInt8, IsShort, IsInteger

Function IsInt64(Argument As id) As Boolean

Returns true if a variable represents an integer (Byte, Short...) type.


Dim i As Byte
Dim x As String

Print IsByte(i)
Print IsByte(x)
Dim x As Boolean

Print IsBoolean(x)


Alias IsByte, IsInt16, IsInt32, IsInt8, IsShort, IsInteger

Function IsInt8(Argument As id) As Boolean

Returns true if a variable represents an integer (Byte, Short...) type.


Dim i As Byte
Dim x As String

Print IsByte(i)
Print IsByte(x)
Dim x As Boolean

Print IsBoolean(x)


Alias IsByte, IsInt16, IsInt32, IsInt64, IsShort, IsInteger

Function IsInteger(Argument As id) As Boolean

Returns true if a variable represents an integer (Byte, Short...) type.


Dim i As Byte
Dim x As String

Print IsByte(i)
Print IsByte(x)
Dim x As Boolean

Print IsBoolean(x)


Alias IsByte, IsInt16, IsInt32, IsInt64, IsInt8, IsShort

Function IsMac32Bit() As Boolean

Returns Yes on a 32 bit Mac.

Function IsMac64Bit() As Boolean

Returns Yes on a 64 bit Mac.

Function IsNumber(Argument As id) As Boolean

Returns a Boolean value that indicates whether the given object is a boolean, byte, short, integer, long, single, or double object.

Function IsPoint(Argument As id) As Boolean

Returns a Boolean value that indicates whether the given objects is a point object.

Function IsRange(Argument As id) As Boolean

Returns a Boolean value that indicates whether the given objects is a range object.

Function IsRect(Argument As id) As Boolean

Returns a Boolean value that indicates whether the given objects is a rect object.

Function IsShort(Argument As id) As Boolean

Returns true if a variable represents an integer (Byte, Short...) type.


Dim i As Byte
Dim x As String

Print IsByte(i)
Print IsByte(x)
Dim x As Boolean

Print IsBoolean(x)


Alias IsByte, IsInt16, IsInt32, IsInt64, IsInt8, IsInteger

Function IsSingle(Argument As id) As Boolean

Returns true if a variable represents a float type.

Dim i As Float
Dim x As String

Print IsFloat(i)
Print IsFloat(x)


Alias IsDouble, IsFloat

Function IsSize(Argument As id) As Boolean

Returns a Boolean value that indicates whether the given objects is a size object.

Function IsString(Argument As id) As Boolean

Returns true if expression represents a string value.

Dim i As Integer
Dim k As String

MsgBox(IsString(i))
MsgBox(IsString(k))


Function IsValue(Argument As id) As Boolean

Returns a Boolean value that indicates whether the given object is a Size, Range, Rect or Point object.

Function Join(Argument As Array, Separator As String) As String

Join(...) returns a string, which consists of all elements of a list changed to a string. Between each of them is a given separator string.

Function LCase(Argument As String) As String

LCase(...) changes all characters of a string to lowercase. It then returns a copy of the string.

Dim src As String
src = "Mr. Big was HERE"
MsgBox(LCase(src))

' Output:
' mr. big was here


See also UCase
Alias Lower

Function Label() As Label

Creates and returns a new object based on the class 'Label'.

Function LastIndexOf(Argument As String, Search As String, Index As Integer = -1, CaseSensitive As Boolean = True) As Integer

LastIndexOf(...) returns the position of the first occurrence a given string inside another string starting from the end. It returns -1, if the string could not be found.

Dim x As String, y As String

x = "This is a string"
y = "s"

MsgBox(InStRev(x, y))


Alias InStrRev

Function Launch(AppNameOrFilePath As String [, FileToOpen As String[, Activate As Boolean]]) As Boolean

Launch(...) starts up any application which exists on that path and with that file name.

See also Run

Function Left(Argument As String, Position As Integer) As String

Left(...) returns the leftmost part of a string containing 'Position' number of characters.

Dim src As String
src = "What a nice day"
MsgBox(Left(src, 4))


See also Right, Mid

Function Len(Argument As String) As Integer

Len(...) returns the length of a string.

Alias Length

Function Length(Argument As String) As Integer

Length(...) returns the length of a string.

Alias Len

Function Ln(Argument As Float) As Float

Ln(...) returns the natural logarithm of the given argument. The Ln function calculates the base 'e' (or natural) logaritm of a number. Input number must be a positive (i.e. > 0).

Dim x As Integer
x = 12
MsgBox(Ln(x))


See also Log10

Function Log10(Argument As Float) As Float

Log10(...) returns the common (base-10) logarithm of the given argument (calculates the ten-based logarithmic of a number). Input number must be a positive (i.e. > 0).

See also Ln

Function Long() As Long

Creates and returns a new object of type 'Long'.

Function Lower(Argument As String) As String

Lower(...) changes all characters of a string to lowercase. It then returns a copy of the string.

Dim src As String
src = "Mr. Big was HERE"
MsgBox(LCase(src))

' Output:
' mr. big was here


See also UCase
Alias LCase

Function Max(Value1 As Float, Value2 As Float) As Float

Max(...) compares two values and returns the bigger one. Both values are treated as Float values.

MsgBox(44, 4)


See also Min

Function Min(Value1 As Float, Value2 As Float) As Float

Min(...) compares two values and returns the smaller one. Both values are treated as Float values.

See also Max

Function MovieView() As MovieView

Creates and returns a new object based on the class 'MovieView'.

Sub MsgBox(Title As id [, Message As id])

MsgBox(...) shows a message on the screen. It is either is a small modal window with a title and a message or just a message only. Very useful for showing information to the user or to debug during application development.

See also InputBox, BeginAlertSheet
Alias Alert

Function NSActionCell() As NSActionCell

Creates and returns a new object based on the class 'NSActionCell'.

Function NSAlert() As NSAlert

Creates and returns a new object based on the class 'NSAlert'.

Function NSApplication() As NSApplication

Creates and returns a new object based on the class 'NSApplication'.

Function NSArray() As NSArray

Creates and returns a new object based on the class 'NSArray'.

Function NSArrayController() As NSArrayController

Creates and returns a new object based on the class 'NSArrayController'.

Function NSAttributedString() As NSAttributedString

Creates and returns a new object based on the class 'NSAttributedString'.

Function NSBox() As NSBox

Creates and returns a new object based on the class 'NSBox'.

Function NSButton() As NSButton

Creates and returns a new object based on the class 'NSButton'.

Function NSButtonCell() As NSButtonCell

Creates and returns a new object based on the class 'NSButtonCell'.

Function NSCell() As NSCell

Creates and returns a new object based on the class 'NSCell'.

Function NSColor() As NSColor

Creates and returns a new object based on the class 'NSColor'.

Function NSColorWell() As NSColorWell

Creates and returns a new object based on the class 'NSColorWell'.

Function NSComboBox() As NSComboBox

Creates and returns a new object based on the class 'NSComboBox'.

Function NSControl() As NSControl

Creates and returns a new object based on the class 'NSControl'.

Function NSController() As NSController

Creates and returns a new object based on the class 'NSController'.

Function NSCursor() As NSCursor

Creates and returns a new object based on the class 'NSCursor'.

Function NSData() As NSData

Creates and returns a new object based on the class 'NSData'.

Function NSDatePicker() As NSDatePicker

Creates and returns a new object based on the class 'NSDatePicker'.

Function NSDictionary() As NSDictionary

Creates and returns a new object based on the class 'NSDictionary'.

Function NSDictionaryController() As NSDictionaryController

Creates and returns a new object based on the class 'NSDictionaryController'.

Function NSDrawer() As NSDrawer

Creates and returns a new object based on the class 'NSDrawer'.

Function NSFileManager() As NSFileManager

Creates and returns a new object based on the class 'NSFileManager'.

Function NSFont() As NSFont

Creates and returns a new object based on the class 'NSFont'.

Function NSImage() As NSImage

Creates and returns a new object based on the class 'NSImage'.

Function NSImageCell() As NSImageCell

Creates and returns a new object based on the class 'NSImageCell'.

Function NSImageView() As NSImageView

Creates and returns a new object based on the class 'NSImageView'.

Function NSLevelIndicator() As NSLevelIndicator

Creates and returns a new object based on the class 'NSLevelIndicator'.

Function NSMatrix() As NSMatrix

Creates and returns a new object based on the class 'NSMatrix'.

Function NSMenu() As NSMenu

Creates and returns a new object based on the class 'NSMenu'.

Function NSMenuItem() As NSMenuItem

Creates and returns a new object based on the class 'NSMenuItem'.

Function NSMenuItemCell() As NSMenuItemCell

Creates and returns a new object based on the class 'NSMenuItemCell'.

Function NSMutableArray() As NSMutableArray

Creates and returns a new object based on the class 'NSMutableArray'.

Function NSMutableAttributedString() As NSMutableAttributedString

Creates and returns a new object based on the class 'NSMutableAttributedString'.

Function NSMutableData() As NSMutableData

Creates and returns a new object based on the class 'NSMutableData'.

Function NSMutableDictionary() As NSMutableDictionary

Creates and returns a new object based on the class 'NSMutableDictionary'.

Function NSMutableString() As NSMutableString

Creates and returns a new object based on the class 'NSMutableString'.

Function NSNotification() As NSNotification

Creates and returns a new object based on the class 'NSNotification'.

Function NSObject() As NSObject

Creates and returns a new object based on the class 'NSObject'.

Function NSObjectController() As NSObjectController

Creates and returns a new object based on the class 'NSObjectController'.

Function NSPanel() As NSPanel

Creates and returns a new object based on the class 'NSPanel'.

Function NSPopUpButton() As NSPopUpButton

Creates and returns a new object based on the class 'NSPopUpButton'.

Function NSPopUpButtonCell() As NSPopUpButtonCell

Creates and returns a new object based on the class 'NSPopUpButtonCell'.

Function NSProgressIndicator() As NSProgressIndicator

Creates and returns a new object based on the class 'NSProgressIndicator'.

Function NSResponder() As NSResponder

Creates and returns a new object based on the class 'NSResponder'.

Function NSScrollView() As NSScrollView

Creates and returns a new object based on the class 'NSScrollView'.

Function NSSearchField() As NSSearchField

Creates and returns a new object based on the class 'NSSearchField'.

Function NSSecureTextField() As NSSecureTextField

Creates and returns a new object based on the class 'NSSecureTextField'.

Function NSSegmentedControl() As NSSegmentedControl

Creates and returns a new object based on the class 'NSSegmentedControl'.

Function NSSlider() As NSSlider

Creates and returns a new object based on the class 'NSSlider'.

Function NSSplitView() As NSSplitView

Creates and returns a new object based on the class 'NSSplitView'.

Function NSStepper() As NSStepper

Creates and returns a new object based on the class 'NSStepper'.

Function NSString() As NSString

Creates and returns a new object based on the class 'NSString'.

Function NSTabView() As NSTabView

Creates and returns a new object based on the class 'NSTabView'.

Function NSTableColumn() As NSTableColumn

Creates and returns a new object based on the class 'NSTableColumn'.

Function NSTableView() As NSTableView

Creates and returns a new object based on the class 'NSTableView'.

Function NSTask() As NSTask

Creates and returns a new object based on the class 'NSTask'.

Function NSText() As NSText

Creates and returns a new object based on the class 'NSText'.

Function NSTextField() As NSTextField

Creates and returns a new object based on the class 'NSTextField'.

Function NSTextView() As NSTextView

Creates and returns a new object based on the class 'NSTextView'.

Function NSThread() As NSThread

Creates and returns a new object based on the class 'NSThread'.

Function NSTimer() As NSTimer

Creates and returns a new object based on the class 'NSTimer'.

Function NSToolbar() As NSToolbar

Creates and returns a new object based on the class 'NSToolbar'.

Function NSToolbarItem() As NSToolbarItem

Creates and returns a new object based on the class 'NSToolbarItem'.

Function NSTreeController() As NSTreeController

Creates and returns a new object based on the class 'NSTreeController'.

Function NSUserDefaultsController() As NSUserDefaultsController

Creates and returns a new object based on the class 'NSUserDefaultsController'.

Function NSView() As NSView

Creates and returns a new object based on the class 'NSView'.

Function NSViewController() As NSViewController

Creates and returns a new object based on the class 'NSViewController'.

Function NSWindow() As NSWindow

Creates and returns a new object based on the class 'NSWindow'.

Function NSWindowController() As NSWindowController

Creates and returns a new object based on the class 'NSWindowController'.

Function Nz(Argument As id, ReturnValue As id = "") As String

Nz(...) checks for null and returns an empty string (nullstring), if needed.

Function test()
Return Null
End Function

MsgBox("'_" + Nz(test()) + "_'" ' --> "")


Function OBBackgroundView() As OBBackgroundView

Creates and returns a new object based on the class 'OBBackgroundView'.

Function OBPreferences() As OBPreferences

Creates and returns a new object based on the class 'OBPreferences'.

Function OBTask() As OBTask

Creates and returns a new object based on the class 'OBTask'.

Function OBTextView() As OBTextView

Creates and returns a new object based on the class 'OBTextView'.

Function OffsetRect(Argument As Rect, OffsetX As Integer, OffsetY As Integer) As Rect

OffsetRect(...) returns a new rect with offset from a given rect. It is used to simply 'offset', or move a given rect to another location specified by the x and y offset values.

Function Point(
| no arguments
) As Point

Creates and returns a new object based on the class 'Point'.
Or creates and returns a new object of type 'Point'.

Function PointInRect(Argument As Point, WhereIn As Rect) As Boolean

PointInRect(...) returns 'Yes' if the given point is inside a rect.

Sub Preferences()

Preferences(...) shows up the preference window of your application. The file Preference must set and a Preferences.xib must be in the project.

Function Prepend(Argument As String, Prepend As String) As String

Prepend(...) returns a new string as a combination of both given strings.

Sub Preview(FilePath As String)

Preview(...) shows up the Mac OS X Preview application (PDF Viewer), and makes it open any file.

Function PushButton() As PushButton

Creates and returns a new object based on the class 'PushButton'.

Function RND([Argument As Float]) As Float

RND(...) returns a float pseudo-random number. If an argument is given random values between 0 and the argument are returned only. If no argument is given, the next random number in the list is created and returned. If you use RND(...) the first time and you have not called Randomize() before, it is automatically called and new random numbers are created.

Randomize
Dim x, y
x = Int(Random(6)) + 1
y = Int(Random(6)) + 1
MsgBox("2 turns with one dice: turn 1 = " & x & " and turn 2 = " & y)


Alias Random

Function RadioButton() As RadioButton

Creates and returns a new object based on the class 'RadioButton'.

Function Random([Argument As Float]) As Float

Random(...) returns a float pseudo-random number. If an argument is given random values between 0 and the argument are returned only. If no argument is given, the next random number in the list is created and returned. If you use Random(...) the first time and you have not called Randomize() before, it is automatically called and new random numbers are created.

Randomize
Dim x, y
x = Int(Random(6)) + 1
y = Int(Random(6)) + 1
MsgBox("2 turns with one dice: turn 1 = " & x & " and turn 2 = " & y)


Alias RND

Sub Randomize()

Randomize() restarts the internal random number generator based on the current local system time. Using it only makes sense, if you want to use the Random() function as well.

See also Random

Function Range(
| no arguments
) As Range

Creates and returns a new object based on the class 'Range'.
Or creates and returns a new object of type 'Range'.

Function ReadArray(FilePathOrURL As String) As Array

ReadArray(...) loads an entire file from a path or on a website into an array. You may even read html webpages with this function.

Function ReadDictionary(FilePathOrURL As String) As Dictionary

ReadDictionary(...) loads an entire file from a path or on a website into a Dictionary. You may even read html webpages with this function.

Function ReadString(FilePathOrURL As String) As String

ReadString(...) loads an entire file from a path or on a website into a string.

Function RecessedButton() As RecessedButton

Creates and returns a new object based on the class 'RecessedButton'.

Function Rect(
| no arguments
) As Rect

Creates and returns a new object based on the class 'Rect'.
Or creates and returns a new object of type 'Rect'.

Function Replace(Argument As String, Search As String, Replace As String, CaseSensitive As Boolean = True) As String

Replace(...) changes all occurrences of a string inside another string to a new string.

Dim s = "Das ist alles was wir brauchen. Fang nochmal von vorne an."
Dim search = "vorne"
Dim replace = "hinten"
MsgBox(Replace(s, search, replace))


Function Reversed(Argument As String) As String

Reversed(...) returns a given string reversed.

Function Right(Argument As String, Position As Integer) As String

Right(...) returns the rightmost part of a string beginning at 'Position' (returns a string containing the last characters of a string).

MsgBox(Right("I'm living in Germany", 7))
' MsgBox(Right("I'm living in Germany", Len("Germany")))


Function Round(Argument As Float, Precision As Integer) As Float

Round(...) rounds a value, while Precision determines the number of digits after the decimal point.

MsgBox(Round(34.45D2))
MsgBox(Round(34.456D2))
MsgBox(Round(34.451D2))
MsgBox(Round(34.4567D2))
MsgBox(Round(34.4561D2))
MsgBox(Round(34.4517D2))

MsgBox(Round(34.4567D3))
MsgBox(Round(34.4517D3))
MsgBox(Round(34.4567D4))
MsgBox(Round(34.4561D4))


Function RoundButton() As RoundButton

Creates and returns a new object based on the class 'RoundButton'.

Function RoundedRectButton() As RoundedRectButton

Creates and returns a new object based on the class 'RoundedRectButton'.

Function RoundedTexturedButton() As RoundedTexturedButton

Creates and returns a new object based on the class 'RoundedTexturedButton'.

Function Run(FilePath As String, Arguments As Array) As String


See also Launch

Sub Safari(FilePath As String)

Safari(...) launches the Mac OS X Safari application (Internet Browser), which displays the given URL page.

Function ScreenRect() As Rect

Refers to the screen containing the window with the keyboard focus. The screen is not necessarily the same screen that contains the menu bar or has its origin at (0, 0). The main screen refers to the screen containing the window that is currently receiving keyboard events. It is the main screen because it is the one with which the user is most likely interacting. Returns the full screen rectangle at the current resolution. This rectangle includes any space currently occupied by the menu bar and dock.

Function Short() As Short

Creates and returns a new object of type 'Short'.

Function Sin(Argument As Float) As Float

Sin(...) returns the sine of the argument 'number' in radians.

Const PI = 3.141592654
Print Atn(Tan(PI / 4.0)), PI / 4.0 ' result: .7853981635 .7853981635
Print(Cos(180 *(PI / 180))) ' result: -1
Print(Sin(90 *(PI / 180))) ' result: 1
Print(Tan(45 *(PI / 180))) ' result: 1.000000000205103


Function Single() As Single

Creates and returns a new object of type 'Single'.

Function Size(
| no arguments
) As Size

Creates and returns a new object based on the class 'Size'.
Or creates and returns a new object of type 'Size'.

Function Space(Count As Integer, FillWith As String = " ") As String

Space(...) function creates a string consisting of spaces (or other characters) based on x length.

MsgBox("*" + Space(5) + "*")

' Output:
' * *

MsgBox(Space $(4.3 + 2))

MsgBox("*" + Space(5) + "*")


Function Split(Argument As String, Separator As String) As Array

Split(...) returns an array containing string objects from the given string, which have been separated by a string pattern.

Function Sqr(Argument As Float) As Float

Sqr(...) returns the square root of the argument 'number'.

MsgBox(Sqr(25), Sqr(2)) ' results: 5 1.414214


See also Fix, CInt

Function SquareButton() As SquareButton

Creates and returns a new object based on the class 'SquareButton'.

Function StartsWith(Argument As String, Search As String, CaseSensitive As Boolean = True) As Boolean

StartsWith(...) finds out if a given string starts with another string.

Function Str(Expression As id, Locale As Boolean = False) As String

Converts a number to a string. Locale is ignored for now.

MsgBox(Str(239.546))


Alias String

Function StrReverse(Argument As String) As String

StrReverse(...) returns a all parts of a string mirrored.

Dim s = "Mondscheinsonate by Beethoven"
MsgBox(StrReverse(s)) ' --> nevohteeB yb etanosniehcsdnoM


Function String(
| no arguments
) As String

Creates and returns a new object based on the class 'String'.
Or creates and returns a new object of type 'String'.

Function Tan(Argument As Float) As Float

Tan(...) returns the tangent of the argument 'number' in radians.

Sub TextEdit(FilePath As String)

TextEdit(...) shows up the Mac OS X TextEdit application (RTF Editor), which opens the specified file.

Function TexturedButton() As TexturedButton

Creates and returns a new object based on the class 'TexturedButton'.

Sub Trace()

Trace() writes information about the current execution position within your program to stderr (code file, code line, procedure name...).

Function Trim(Argument As String) As String

Trim(...) returns a string, in which all whitespace characters at the beginning and end have been removed (removes the source string's leading and trailing spaces and other non-printable characters).

Dim x As String
x = " My house is on fire. "
MsgBox("test..." & Trim(x) & "...test")

' Output:
' test...My house is on fire....test


See also LTrim, RTrim
Alias Trimmed

Function Trimmed(Argument As String) As String

Trimmed(...) returns a string, in which all whitespace characters at the beginning and end have been removed (removes the source string's leading and trailing spaces and other non-printable characters).

Dim x As String
x = " My house is on fire. "
MsgBox("test..." & Trim(x) & "...test")

' Output:
' test...My house is on fire....test


See also LTrim, RTrim
Alias Trim

Function UCase(Argument As String) As String

UCase(...) changes all characters of a string to uppercase (contains the source string converted to all upper case).

Dim src As String
src = "Mr. Big was HERE"
MsgBox(UCase(src))

' Output:
' MR. BIG WAS HERE


See also UCase
Alias Upper

Function Unicode(Argument As String [, Index As Integer]) As Integer

Unicode(...) returns the unicode integer value of an character at the given position inside a string.

See also Chr
Alias Asc

Function UnionRect(Argument As Rect, OtherRect As Rect) As Rect

UnionRect(...) returns a combination of two rects (rect that contains the portion of the two argument rects that overlap).

Function Upper(Argument As String) As String

Upper(...) changes all characters of a string to uppercase (contains the source string converted to all upper case).

Dim src As String
src = "Mr. Big was HERE"
MsgBox(UCase(src))

' Output:
' MR. BIG WAS HERE


See also UCase
Alias UCase

Function VerticalLine() As VerticalLine

Creates and returns a new object based on the class 'VerticalLine'.

Function VerticalSplitView() As VerticalSplitView

Creates and returns a new object based on the class 'VerticalSplitView'.

Function WriteArray(Argument As Array, FilePathOrURL As String) As Boolean

WriteArray(...) saves the entire Array in a file to a given path.

Function WriteDictionary(Argument As Dictionary, FilePathOrURL As String) As Boolean

WriteDictionary(...) saves the entire Dictionary in a file to a given path.

Function WriteString(Argument As String, FilePathOrURL As String) As Boolean

WriteString(...) saves the entire string in a file to a given path. URL is not supported yet.

Function arch() As String

Returns '''i486''' on an Intel Mac Core 2 Duo. Values depend on Mac running.

Function id() As id

Creates and returns a new object of type 'id'.

Function plist(FilePathOrURL As String) As Dictionary

plist(...) is an easy way to read in plist files (XML files storing object values of dictionaries in a human-readable format).

See also ReadDictionary, WriteDictionary


























































































Objects

Object App


Object AppDelegate

Overview

ApplicationWillFinishLaunching applicationDidBecomeActive applicationDidChangeScreenParameters applicationDidHide applicationDidResignActive applicationDidUnhide applicationDockMenu applicationShouldTerminate applicationShouldTerminateAfterLastWindowClosed applicationWillBecomeActive applicationWillHide applicationWillResignActive applicationWillUnhide


Events

Event ApplicationWillFinishLaunching(notification As NSNotification)

Event applicationDidBecomeActive(notification As NSNotification)

Event applicationDidChangeScreenParameters(notification As NSNotification)

Event applicationDidHide(notification As NSNotification)

Event applicationDidResignActive(notification As NSNotification)

Event applicationDidUnhide(notification As NSNotification)

Event applicationDockMenu(sender As NSApplication)

Event applicationShouldTerminate(sender As NSApplication)

Event applicationShouldTerminateAfterLastWindowClosed(sender As NSApplication)

Event applicationWillBecomeActive(notification As NSNotification)

Event applicationWillHide(notification As NSNotification)

Event applicationWillResignActive(notification As NSNotification)

Event applicationWillUnhide(notification As NSNotification)



Object CMath

Overview

acos acosh annuity asin asinh atan atan2 atanh ceil compound cos cosh erf erfc exp expm1 fabs fdim floor gamma hypot isfinite isnan isnormal lgamma log log10 log1p log2 logb nearbyint pow remainder rint rinttol round scalb sin sinh sqrt tan tanh trunc


Subs & Functions

Function acos(Argument As Double) As Double

Function acosh(Argument As Double) As Double

Function annuity(rate As Double, periods As Double) As Double

rate As Double, periods As Doubles

Function asin(Argument As Double) As Double

Function asinh(Argument As Double) As Double

Function atan(Argument As Double) As Double

Function atan2(x As Double, y As Double) As Double

Function atanh(Argument As Double) As Double

Function ceil(Argument As Double) As Double

Function compound(rate As Double, periods As Double) As Double

rate As Double, periods As Doubles

Function cos(Argument As Double) As Double

Function cosh(Argument As Double) As Double

Function erf(Argument As Double) As Double

The error function

Function erfc(Argument As Double) As Double

Complementary error function

Function exp(Argument As Double) As Double

Function expm1(Argument As Double) As Double

expm1(x) is more accurate than exp(x) - 1

Function fabs(Argument As Double) As Double

Function fdim(x As Double, y As Double) As Double

Computes the 'positive difference' between its arguments

Function floor(Argument As Double) As Double

Function gamma(Argument As Double) As Double

The gamma function

Function hypot(Argument As Double, 2ndArgument As Double) As Double

Returns x raised to the power of y

Function isfinite(x As Double) As Integer

Non-zero if and only if the argument x is finite

Function isnan(x As Double) As Integer

Non-zero if and only if the argument x is a NaN

Function isnormal(x As Double) As Integer

Non-zero if and only if the argument x is normalized

Function lgamma(x As Double) As Double

Determines the base-e logarithm of the absolute value of gamma of its argument x, for x > 0

Function log(Argument As Double) As Double

Function log10(Argument As Double) As Double

Function log1p(Argument As Double) As Double

log1p = log(1 + x). However, for small enough arguments, log1p is more accurate than log(1 + x))

Function log2(Argument As Double) As Double

Function logb(Argument As Double) As Double

Gets the exponent of its argument, as a signed integral value

Function nearbyint(x As Double) As Double

Does not raise the inexact exception

Function pow(x As Double, y As Double) As Double

Returns x raised to the power of y

Function remainder(x As Double, y As Double) As Double

Function rint(x As Double) As Double

Rounds its argument to an integral value in floating point format, using the current rounding direction

Function rinttol(x As Double) As Integer

Rounds its argument to the nearest Integer using the current rounding direction

Function round(Argument As Double) As Double

Function scalb(x As Double, n As Double) As Double

Determines x * 2^n fast

Function sin(Argument As Double) As Double

Function sinh(Argument As Double) As Double

Function sqrt(Argument As Double) As Double

Function tan(Argument As Double) As Double

Function tanh(Argument As Double) As Double

Function trunc(x As Double) As Double

Determines the integral value, in floating format


Object Debug

Overview

ClassName File Info Line Scope SuperClassName


Subs & Functions

Function ClassName() As String

Function File() As String

Function Info() As String

Function Line() As String

Function Scope() As String

Function SuperClassName() As String



Object File

Overview

Copy CreateDir CreateFile List Move RemoveFile


Subs & Functions

Function Copy(SourcePath As String, DestinationPath As String) As Boolean

Function CreateDir(Path As String) As Boolean

Function CreateFile(Path As String) As Boolean

Function List(Path As String) As Array

Function Move(SourcePath As String, DestinationPath As String) As Boolean

Function RemoveFile(Path As String) As Boolean



Object FirstResponder

Overview

SendAction SendAction2


Subs & Functions

Function SendAction(Argument As id) As Boolean

Returns the full pathname of the bundle's subdirectory containing resources

Function SendAction2(Argument As id) As Boolean

Returns the full pathname of the bundle's subdirectory containing resources


Object NSBundle

Overview

BundlePath ExecutablePath ResourcePath


Subs & Functions

Function BundlePath() As String

Returns the full pathname of the bundle directory

Function ExecutablePath() As String

Returns the full pathname of the executable file

Function ResourcePath() As String

Returns the full pathname of the bundle's subdirectory containing resources


Object NSNotificationCenter

Overview

AddObserver PostNotificationName RemoveObserver


Subs & Functions

Sub AddObserver(ActionName As String, ForSender As id)

Sub PostNotificationName(ActionName As String, UserInfo As Dictionary)

Sub RemoveObserver(ActionName As String, ForSender As id)



Object NSOpenPanel

Overview

AllowsMultipleSelection CanChooseDirectories CanChooseFiles Directory File FileName FileNames ResolvesAliases Run Types URL URLs


Properties

Property AllowsMultipleSelection As Boolean

Property CanChooseDirectories As Boolean

Property CanChooseFiles As Boolean

Property Directory As String

Property File As String

Property ResolvesAliases As Boolean

Property Types As Array



Subs & Functions

Function FileName() As String

Function FileNames() As Array

Function Run() As Boolean

Function URL() As String

Function URLs() As Array



Object NSProcessInfo

Overview

Arguments Environment PID


Subs & Functions

Function Arguments() As NSArray

Function Environment() As NSDictionary

Function PID() As Integer



Object NSSavePanel

Overview

Title


Properties

Property Title As String



Object NSUserDefaults

Overview

Get RegisterDefaults Remove Set Synchronize


Subs & Functions

Function Get(Key As String) As id

Sub RegisterDefaults(Defaults As Dictionary)

Sub Remove(Key As String)

Function Set(Key As String, Value As id) As Boolean

Sub Synchronize()



Object User

Overview

DesktopDirectory FullUserName HomeDirectory HomeDirectoryForUser TemporaryDirectory UserName


Subs & Functions

Function DesktopDirectory() As String

Returns the path to the current user's desktop directory

Function FullUserName() As String

Returns the full name of the current user

Function HomeDirectory() As String

Returns the path to the current user's home directory

Function HomeDirectoryForUser(UserName As String) As String

Returns the home directory path for a given user

Function TemporaryDirectory() As String

Returns the temporary directory

Function UserName() As String

Returns the name of the current user (logon name)




























































































Classes

Class MovieView

Super Classes

NSObject


Class NSActionCell

Super Classes

NSCell NSObject

Child Classes

NSButtonCell

Overview

Title


Properties

Property Title As String



Class NSAlert

Super Classes

NSObject


Class NSApplication

Super Classes

NSResponder NSObject

Overview

ActivateIgnoringOtherApps ApplicationIconImage CurrentEvent HideOtherApplications HideSpotlightForHelp KeyWindow MainMenu ShowOtherApplication Terminate UnhideAllApplications


Properties

Property ApplicationIconImage As NSImage



Subs & Functions

Sub ActivateIgnoringOtherApps(Flag As Boolean)

Function CurrentEvent() As NSEvent

Sub HideOtherApplications(Sender As id)

Sub HideSpotlightForHelp()

Function KeyWindow() As NSWindow

Function MainMenu() As NSMenu

Sub ShowOtherApplication(PID As Integer)

Sub Terminate(Sender As id)

Sub UnhideAllApplications(Sender As id)



Class NSArray

Super Classes

NSObject

Child Classes

Array NSMutableArray

Overview

Contains Count Object


Subs & Functions

Function Contains(Argument As id) As Boolean

Function Count() As Integer

Function Object(Index As Integer) As id



Class NSArrayController

Super Classes

NSObjectController NSController NSObject

Child Classes

NSDictionaryController


Class NSAttributedString

Super Classes

NSObject

Child Classes

NSMutableAttributedString


Class NSBox

Super Classes

NSView NSResponder NSObject

Child Classes

VerticalLine HorizontalLine

Overview

BorderType BoxType FillColor Title


Properties

Property BorderType As Integer

Property BoxType As Integer

Property FillColor As NSColor

Property Title As String



Class NSButton

Super Classes

NSControl NSView NSResponder NSObject

Child Classes

TexturedButton SquareButton RoundedTexturedButton RoundedRectButton RoundButton RecessedButton RadioButton PushButton HelpButton GradientButton DisclosureTriangle DisclosureButton CheckBox BevelButton NSPopUpButton

Overview

AllowsMixedState AlternateImage AlternateTitle AttributedAlternateTitle AttributedTitle BezelStyle Bordered ButtonType Highlight Image ImagePosition KeyEquivalent KeyEquivalentModifierMask SetNextState State TextColor Title Transparent


Properties

Property AllowsMixedState As Boolean

Property AlternateImage As NSImage

Property AlternateTitle As String

Property AttributedAlternateTitle As String

Property AttributedTitle As String

Property BezelStyle As Integer

Property Bordered As Boolean

Property ButtonType As Integer

Property Image As NSImage

Property ImagePosition As Integer

Property KeyEquivalent As String

Property KeyEquivalentModifierMask As Integer

Property State As Integer

Property TextColor As NSColor

Property Title As String

Property Transparent As Boolean



Subs & Functions

Sub Highlight(Argument As Boolean)

Marks the button to be lit.

Sub SetNextState()



Class NSButtonCell

Super Classes

NSActionCell NSCell NSObject

Overview

Title


Properties

Property Title As String



Class NSCell

Super Classes

NSObject

Child Classes

NSImageCell NSActionCell

Overview

Editable Enabled Font ObjectValue StringValue


Properties

Property Editable As Boolean

Property Enabled As Boolean

Property Font As NSFont

Property ObjectValue As id

Property StringValue As String



Class NSColor

Super Classes

NSObject


Class NSColorWell

Super Classes

NSControl NSView NSResponder NSObject


Class NSComboBox

Super Classes

NSControl NSView NSResponder NSObject

Overview

Append ButtonBordered Completes Contains Count Index Insert IntercellSpacing ItemHeight Object Remove RemoveAll RemoveObject ScrollTo Select SelectObject Selected SelectedObject SetNumberOfVisibleItems Unselect VerticalScroller


Properties

Property ButtonBordered As Boolean

Property Completes As Boolean

Property IntercellSpacing As Size

Property ItemHeight As Size

Property VerticalScroller As Boolean



Subs & Functions

Sub Append(Argument As id)

Function Contains(Argument As id) As Boolean

Function Count() As Integer

Function Index(Argument As id) As Integer

Sub Insert(Index As Integer, Argument As id)

Function Object(Index As Integer) As id

Sub Remove(Index As Integer)

Sub RemoveAll()

Sub RemoveObject(Argument As id)

Sub ScrollTo(Index As Integer)

Sub Select(Index As Integer)

Sub SelectObject(Argument As id)

Function Selected() As Integer

Function SelectedObject() As id

Sub SetNumberOfVisibleItems(Argument As Integer)

Sub Unselect(Index As Integer)



Class NSControl

Super Classes

NSView NSResponder NSObject

Child Classes

NSTextField NSTableView NSStepper NSSlider NSSegmentedControl NSMatrix NSLevelIndicator NSImageView NSDatePicker NSComboBox NSColorWell NSButton

Overview

ActionName Alignment AttributedString Cell Delegate DoubleValue Enabled Font Formatter IntegerValue ObjectValue RefusesFirstResponder SingleValue SizeToFit StringValue Tag Target


Properties

Property ActionName As String

Property Alignment As Integer

Property AttributedString As String

Property Cell As NSCell

Property Delegate As id

Property DoubleValue As Double

Property Enabled As Boolean

Property Font As NSFont

Property Formatter As NSFormatter

Property IntegerValue As Integer

Property ObjectValue As id

Property RefusesFirstResponder As Boolean

Property SingleValue As Single

Property StringValue As String

Property Tag As Integer

Property Target As id



Subs & Functions

Sub SizeToFit()



Class NSController

Super Classes

NSObject

Child Classes

NSUserDefaultsController NSObjectController


Class NSCursor

Super Classes

NSObject

Overview

Set


Subs & Functions

Sub Set()



Class NSData

Super Classes

NSObject

Child Classes

Data NSMutableData

Overview

Count


Subs & Functions

Function Count() As Integer



Class NSDatePicker

Super Classes

NSControl NSView NSResponder NSObject


Class NSDictionary

Super Classes

NSObject

Child Classes

Dictionary NSMutableDictionary

Overview

Contains Count Key Keys Object Value Values


Subs & Functions

Function Contains(Key As String) As Boolean

Function Count() As Integer

Function Key(Index As Integer) As String

Function Keys() As Array

Function Object(IndexOrKey As id) As id

Function Value(IndexOrKey As id) As id

Function Values() As Array



Class NSDictionaryController

Super Classes

NSArrayController NSObjectController NSController NSObject


Class NSDrawer

Super Classes

NSObject

Overview

ParentWindow Toggle ToggleRightResizingWindow


Properties

Property ParentWindow As NSWindow



Subs & Functions

Sub Toggle()

Sub ToggleRightResizingWindow()



Class NSEvent

Super Classes

NSObject

Overview

Characters Key LocationInWindow


Subs & Functions

Function Characters() As String

Function Key() As Integer

Function LocationInWindow() As Point



Class NSFileManager

Super Classes

NSObject

Overview

Copy Create CreateDirectory CreateFile Delete Exists ExistsDirectory ExistsFile IsDeletable IsExecutable IsReadable IsWritable Link List Move Path


Properties

Property Path As String



Subs & Functions

Function Copy(SourcePath As String, DestinationPath As String) As Boolean

Function Create(Path As String) As Boolean

Function CreateDirectory(Path As String) As Boolean

Function CreateFile(Path As String) As Boolean

Function Delete(Path As String) As Boolean

Function Exists(Path As String) As Boolean

Function ExistsDirectory(Path As String) As Boolean

Function ExistsFile(Path As String) As Boolean

Function IsDeletable(Path As String) As Boolean

Function IsExecutable(Path As String) As Boolean

Function IsReadable(Path As String) As Boolean

Function IsWritable(Path As String) As Boolean

Function Link(SourcePath As String, DestinationPath As String) As Boolean

Function List(Path As String) As Array

Function Move(SourcePath As String, DestinationPath As String) As Boolean



Class NSFont

Super Classes

NSObject


Class NSImage


Class NSImageCell

Super Classes

NSCell NSObject


Class NSImageView

Super Classes

NSControl NSView NSResponder NSObject

Overview

Image ImageScaling


Properties

Property Image As NSImage

Property ImageScaling As Integer



Class NSLevelIndicator

Super Classes

NSControl NSView NSResponder NSObject


Class NSMatrix

Super Classes

NSControl NSView NSResponder NSObject

Overview

AddRow DrawsBackground DrawsCellBackground Mode SelectedCell


Properties

Property DrawsBackground As Boolean

Property DrawsCellBackground As Boolean

Property Mode As Integer



Subs & Functions

Sub AddRow(Argument As Array)

Function SelectedCell() As id



Class NSMenu

Super Classes

NSObject

Overview

Append AppendMenu AppendMenuItem AppendSeparator Array Count Delegate InsertMenu InsertMenuItem InsertSeparator MenuItem MenuItemWithTag MenuNeedsUpdate MenuWillHighlightMenuItem MenuWillOpen PrependMenu PrependMenuItem PrependSeparator Remove RemoveAll Title


Properties

Property Delegate As id

Property Title As String



Subs & Functions

Sub Append(NameOrNSMenuItem As id)

Sub AppendMenu(Argument As NSMenu)

Sub AppendMenuItem(Argument As NSMenuItem)

Sub AppendSeparator()

Function Array() As Array

Function Count() As Integer

Sub InsertMenu(Argument As NSMenu, Index As Integer)

Sub InsertMenuItem(Argument As NSMenuItem, Index As Integer)

Sub InsertSeparator(Index As Integer)

Function MenuItem(Index As Integer) As NSMenuItem

Function MenuItemWithTag(Tag As Integer) As NSMenuItem

Sub PrependMenu(Argument As NSMenu)

Sub PrependMenuItem(Argument As NSMenuItem)

Sub PrependSeparator()

Sub Remove(Index As Integer)

Sub RemoveAll()



Events

Event MenuNeedsUpdate(menu As NSMenu)

Event MenuWillHighlightMenuItem(menu As NSMenu, item As NSMenuItem)

Event MenuWillOpen(menu As NSMenu)



Class NSMenuItem

Super Classes

NSObject

Overview

ActionName AttributedTitle Enabled Hidden Image KeyEquivalent KeyEquivalentModifierMask RepresentedObject State Submenu Tag Target Title


Properties

Property ActionName As String

Property AttributedTitle As String

Property Enabled As Boolean

Property Hidden As Boolean

Property Image As NSImage

Property KeyEquivalent As String

Property KeyEquivalentModifierMask As Integer

Property RepresentedObject As id

Property State As Integer

Property Submenu As NSMenu

Property Tag As Integer

Property Target As id

Property Title As String



Class NSMenuItemCell

Super Classes

NSObject

Child Classes

NSPopUpButtonCell

Overview

Title


Properties

Property Title As String



Class NSMutableArray

Super Classes

NSArray NSObject

Overview

Append Insert Remove RemoveAll RemoveObject Replace


Subs & Functions

Sub Append(Argument As id)

Sub Insert(Argument As id, Index As Integer)

Sub Remove(Index As Integer)

Sub RemoveAll()

Sub RemoveObject(Argument As id)

Sub Replace(Argument As id, Index As Integer)



Class NSMutableAttributedString

Super Classes

NSAttributedString NSObject


Class NSMutableData

Super Classes

NSData NSObject


Class NSMutableDictionary

Super Classes

NSDictionary NSObject

Overview

Append Contains Insert Key Keys Object Remove RemoveAll Replace Value Values


Subs & Functions

Sub Append(Key As String, Value As id)

Function Contains(Key As String) As Boolean

Sub Insert(Key As String, Value As id)

Function Key(Index As Integer) As String

Function Keys() As Array

Function Object(IndexOrKey As id) As id

Sub Remove(Key As String)

Sub RemoveAll()

Sub Replace(Key As String, Value As id)

Function Value(IndexOrKey As id) As id

Function Values() As Array



Class NSMutableString


Class NSNotification


Class NSObject

Child Classes

OBPreferences NSToolbarItem NSToolbar NSTimer NSThread NSTask NSTableColumn NSString NSResponder NSMenuItemCell NSMenuItem NSMenu NSFont NSFileManager NSEvent NSDrawer NSDictionary NSData NSCursor NSController NSColor NSCell NSAttributedString NSArray NSAlert MovieView

Overview

AwakeFromNib Bind EndAlertSheet EndSheet Finalize Init InstancesRespondsToSelector IsKindOfClass IsMemberOfClass LoadNib PerformSelector PerformSelector2 PerformSelector3 PerformSelectorDelayed PerformSelectorNextRunLoop RespondsToSelector SetValueForKey Unbind ValueForKeyPath init performSelectorOnMainThread stdin


Subs & Functions

Sub Bind(Binding As String, ToObject As id, WithKeyPath As String, Options As Dictionary)

Function InstancesRespondsToSelector(ObjCNotation As String) As Boolean

Function IsKindOfClass(ClassName As String) As Boolean

Function IsMemberOfClass(ClassName As String) As Boolean

Function LoadNib(NibName As String) As Boolean

Function PerformSelector(SelectorName As String) As id

Function PerformSelector2(SelectorName As String, Argument As id) As id

Function PerformSelector3(SelectorName As String, Argument As id, 2ndArgument As id) As id

Sub PerformSelectorDelayed(SelectorName As String, Argument As id, Seconds As Double)

Sub PerformSelectorNextRunLoop(SelectorName As String, Argument As id)

Function RespondsToSelector(ObjCNotation As String) As Boolean

Sub SetValueForKey(Value As id, Key As String)

Sub Unbind(Binding As String)

Function ValueForKeyPath(KeyPath As String) As id

Function init() As id

Sub performSelectorOnMainThread(SelectorName As String, Argument As id, waitUntilDone As Boolean = Yes)



Events

Event AwakeFromNib()

Event Finalize()

Event Init()

Event stdin(input As NSData)

Place it in Global


Delegates

Delegate EndAlertSheet(alert As NSAlert, returnCode As Integer, contextInfo As NSString)

Delegate EndSheet(sheet As NSWindow, returnCode As Integer, contextInfo As NSString)



Class NSObjectController

Super Classes

NSController NSObject

Child Classes

NSTreeController NSArrayController


Class NSPanel

Super Classes

NSWindow NSResponder NSObject

Overview

FloatingPanel


Properties

Property FloatingPanel As Boolean



Class NSPopUpButton

Super Classes

NSButton NSControl NSView NSResponder NSObject

Overview

Append AppendSeparator AppendWithImage AutoenablesItems Count Index Insert InsertWithImage Menu Object PullsDown Remove RemoveAll RemoveTitle Select SelectTitle Selected SelectedObject SelectedTitle Synchronize UnselectAll


Properties

Property AutoenablesItems As Boolean

Property Menu As NSMenu

Property PullsDown As Boolean



Subs & Functions

Sub Append(Title As String)

Function AppendSeparator() As Integer

Sub AppendWithImage(Image As NSImage, Title As String)

Function Count() As Integer

Function Index(Argument As id) As Integer

Sub Insert(Index As Integer, Title As String)

Sub InsertWithImage(Index As Integer, Image As NSImage, Title As String)

Function Object(Index As Integer) As id

Sub Remove(Index As Integer)

Sub RemoveAll()

Sub RemoveTitle(Title As String)

Function Select(Index As Integer) As id

Function SelectTitle(Title As String) As id

Function Selected() As Integer

Function SelectedObject() As id

Function SelectedTitle() As String

Sub Synchronize()

Function UnselectAll() As Integer



Class NSPopUpButtonCell

Super Classes

NSMenuItemCell NSObject

Overview

Menu Select Selected


Properties

Property Menu As NSMenu



Subs & Functions

Sub Select(Index As Integer)

Function Selected() As NSMenuItem



Class NSProgressIndicator

Super Classes

NSView NSResponder NSObject

Child Classes

IndeterminateProgressIncicator CircularProgressIncicator

Overview

DoubleValue MaxValue MinValue StartAnimation


Properties

Property DoubleValue As Double

Property MaxValue As Double

Property MinValue As Double



Subs & Functions

Sub StartAnimation(id)



Class NSResponder

Super Classes

NSObject

Child Classes

NSWindowController NSWindow NSViewController NSView NSApplication

Overview

AcceptsFirstResponder BecomeFirstResponder FlagsChanged KeyDown KeyUp Menu MouseDown MouseDragged MouseEntered MouseExited MouseMoved MouseUp NextResponder OtherMouseDown OtherMouseDragged OtherMouseUp ResignFirstResponder RightMouseDown RightMouseDragged ScrollWheel


Properties

Property Menu As NSMenu

Property NextResponder As id



Events

Event AcceptsFirstResponder()

Event BecomeFirstResponder()

Event FlagsChanged(theEvent As NSEvent)

Event KeyDown(theEvent As NSEvent)

Event KeyUp(theEvent As NSEvent)

Event MouseDown(theEvent As NSEvent)

Event MouseDragged(theEvent As NSEvent)

Event MouseEntered(theEvent As NSEvent)

Event MouseExited(theEvent As NSEvent)

Event MouseMoved(theEvent As NSEvent)

Event MouseUp(theEvent As NSEvent)

Event OtherMouseDown(theEvent As NSEvent)

Event OtherMouseDragged(theEvent As NSEvent)

Event OtherMouseUp(theEvent As NSEvent)

Event ResignFirstResponder()

Event RightMouseDown(theEvent As NSEvent)

Event RightMouseDragged(theEvent As NSEvent)

Event ScrollWheel(theEvent As NSEvent)



Class NSScrollView

Super Classes

NSView NSResponder NSObject

Overview

AutohidesScrollers ContentView DocumentView DrawsBackground HasHorizontalScroller HasVerticalScroller


Properties

Property AutohidesScrollers As Boolean

Property ContentView As NSView

Property DocumentView As NSView

Property DrawsBackground As Boolean

Property HasHorizontalScroller As Boolean

Property HasVerticalScroller As Boolean



Class NSSearchField

Super Classes

NSTextField NSControl NSView NSResponder NSObject

Overview

RecentSearches RecentsAutosaveName SendsWholeSearchString


Properties

Property RecentSearches As Array

Property RecentsAutosaveName As String

Property SendsWholeSearchString As Boolean



Class NSSecureTextField

Super Classes

NSTextField NSControl NSView NSResponder NSObject


Class NSSegmentedControl

Super Classes

NSControl NSView NSResponder NSObject

Overview

Selected


Subs & Functions

Function Selected() As Integer



Class NSSlider

Super Classes

NSControl NSView NSResponder NSObject

Child Classes

CircularSlider


Class NSSplitView

Super Classes

NSView NSResponder NSObject

Child Classes

VerticalSplitView HorizontalSplitView


Class NSStepper

Super Classes

NSControl NSView NSResponder NSObject

Overview

RecentSearches RecentsAutosaveName SendsWholeSearchString


Properties

Property RecentSearches As Array

Property RecentsAutosaveName As String

Property SendsWholeSearchString As Boolean



Class NSString

Super Classes

NSObject


Class NSTabView

Super Classes

NSView NSResponder NSObject

Overview

Select


Subs & Functions

Function Select(Index As Integer) As Integer



Class NSTableColumn

Super Classes

NSObject

Overview

DataCell Editable Identifier MaxWidth MinWidth ResizingMask Title Visible Width


Properties

Property DataCell As id

Property Editable As Boolean

Property Identifier As String

Property MaxWidth As Double

Property MinWidth As Double

Property ResizingMask As Integer

Property Title As String

Property Visible As Boolean

Property Width As Double



Class NSTableView

Super Classes

NSControl NSView NSResponder NSObject

Overview

Append ClickedRow Count DataSource Delegate DoubleActionName GridStyleMask HeaderView ReloadData RowHeight SelectRow SelectedRow TableViewGetObject TableViewNumberOfRows TableViewSetObject Target UsesAlternatingRowBackgroundColors


Properties

Property DataSource As id

Property Delegate As id

Property DoubleActionName As String

Property GridStyleMask As Integer

Property HeaderView As id

Property RowHeight As Double

Property Target As id

Property UsesAlternatingRowBackgroundColors As Boolean



Subs & Functions

Sub Append(TC As NSTableColumn)

Function ClickedRow() As Integer

Function Count() As Integer

Sub ReloadData()

Sub SelectRow(Index As Integer)

Function SelectedRow() As Integer



Delegates

Delegate TableViewGetObject(aTableView As NSTableView, Column As NSTableColumn, Row As Integer) As id

Delegate TableViewNumberOfRows(aTableView As NSTableView) As Integer

Delegate TableViewSetObject(aTableView As NSTableView, TableColumn As NSTableColumn, Index As Integer, Value As id)



Class NSTask

Super Classes

NSObject

Child Classes

OBTask


Class NSText

Super Classes

NSView NSResponder NSObject

Child Classes

NSTextView

Overview

Editable Font


Properties

Property Editable As Boolean

Property Font As NSFont



Class NSTextField

Super Classes

NSControl NSView NSResponder NSObject

Child Classes

Label NSSecureTextField NSSearchField

Overview

AllowsEditingTextAttributes BackgroundColor BezelStyle Bezeled Bordered Delegate DrawsBackground Editable SelectText Selectable TextColor


Properties

Property AllowsEditingTextAttributes As Boolean

Property BackgroundColor As NSColor

Property BezelStyle As Integer

Property Bezeled As Boolean

Property Bordered As Boolean

Property Delegate As id

Property DrawsBackground As Boolean

Property Editable As Boolean

Property Selectable As Boolean

Property TextColor As NSColor



Subs & Functions

Sub SelectText()



Class NSTextView

Super Classes

NSText NSView NSResponder NSObject

Child Classes

OBTextView

Overview

AllowsUndo Append CanRedo CanUndo Copy Cut Delegate Delete Font GotoFirstCharacter HasSelection Insert Paste Redo RichText SelectedText ShouldChangeText TextDidChange TextDidEndEditing TextViewDidChangeSelection TextView_GetCompletion TextView_GetCompletion2 Undo Value


Properties

Property AllowsUndo As Boolean

Property Delegate As id

Property Font As NSFont

Property RichText As Boolean

Property Value As String



Subs & Functions

Sub Append(Text As String)

Function CanRedo() As Boolean

Function CanUndo() As Boolean

Sub Copy()

Sub Cut()

Sub Delete()

Sub GotoFirstCharacter()

Function HasSelection() As Boolean

Sub Insert(Text As String)

Only works if textview is editable by user.

Sub Paste()

Sub Redo()

Function SelectedText() As String

Sub Undo()



Events

Event ShouldChangeText(tv As NSTextView, Array, Dummy)

Event TextDidChange(aNotification As id)

Event TextDidEndEditing(aNotification As id)

Event TextViewDidChangeSelection(aNotification As id)



Delegates

Delegate TextView_GetCompletion(tv As OBTextView, sCompletion As String) As NSString

Delegate TextView_GetCompletion2(tv As OBTextView, sCompletion As String) As NSString



Class NSThread

Super Classes

NSObject

Overview

Cancel IsCancelled IsExecuting IsFinished Start


Subs & Functions

Sub Cancel()

Function IsCancelled() As Boolean

Function IsExecuting() As Boolean

Function IsFinished() As Boolean

Sub Start()



Class NSTimer

Super Classes

NSObject

Overview

Stop


Subs & Functions

Sub Stop()



Class NSToolbar

Super Classes

NSObject

Overview

AllowsUserCustomization AutosavesConfiguration Delegate DisplayMode Hide RunCustomizationPalette SetSelectedItemIdentifier Show ShowsBaselineSeparator SizeMode ToolbarAllowedItemIdentifiers ToolbarDefaultItemIdentifiers ToolbarItem Visible


Properties

Property AllowsUserCustomization As Boolean

Property AutosavesConfiguration As Boolean

Property Delegate As id

Property DisplayMode As Integer

Property ShowsBaselineSeparator As Boolean

Property SizeMode As Integer

Property Visible As Boolean



Subs & Functions

Sub Hide()

Sub RunCustomizationPalette()

Sub SetSelectedItemIdentifier(Argument As String)

Sub Show()



Delegates

Delegate ToolbarAllowedItemIdentifiers(toolbar As NSToolbar) As id

Delegate ToolbarDefaultItemIdentifiers(toolbar As NSToolbar) As id

Delegate ToolbarItem(toolbar As NSToolbar, itemIdentifier As NSString, willBeInserted As Boolean) As NSToolbarItem



Class NSToolbarItem

Super Classes

NSObject

Overview

Enabled Image ItemIdentifier Label MaxSize MinSize PaletteLabel Tag ToolTip View


Properties

Property Enabled As Boolean

Property Image As NSImage

Property ItemIdentifier As String

Property Label As String

Property MaxSize As Size

Property MinSize As Size

Property PaletteLabel As String

Property Tag As Integer

Property ToolTip As String

Property View As NSView



Class NSTreeController

Super Classes

NSObjectController NSController NSObject


Class NSUserDefaultsController

Super Classes

NSController NSObject


Class NSView

Super Classes

NSResponder NSObject

Child Classes

OBBackgroundView CustomView NSText NSTabView NSSplitView NSScrollView NSProgressIndicator NSControl NSBox

Overview

Append AutoresizesSubviews AutoresizingMask Bounds DrawRect FocusRingType Frame Height Hide MouseDownCanMoveWindow Move NextKeyView PerformKeyEquivalent Redraw Remove Replace Resize Show ToolTip Visible Width Window X Y


Properties

Property AutoresizesSubviews As Boolean

Property AutoresizingMask As Integer

Property Bounds As Rect

Property FocusRingType As Integer

Property Frame As Rect

Property Height As Integer

Property NextKeyView As NSView

Property ToolTip As String

Property Visible As Boolean

Property Width As Integer

Property Window As NSWindow

Property X As Integer

Property Y As Integer



Subs & Functions

Sub Append(Argument As NSView)

Sub Hide()

Sub Move(Argument As Point)

Sub Redraw()

Sub Remove(Argument As NSView)

Sub Replace(Replace As NSView, With As NSView)

Sub Resize(Argument As Size)

Sub Show()



Events

Event DrawRect(dirtyRect As NSRect)

Event MouseDownCanMoveWindow()

Event PerformKeyEquivalent(theEvent As NSEvent)



Class NSViewController

Super Classes

NSResponder NSObject


Class NSWindow

Super Classes

NSResponder NSObject

Child Classes

NSPanel

Overview

AcceptsMouseMovedEvents AllowsToolTipsWhenApplicationIsInactive AlphaValue Append BackgroundColor BecomeKeyWindow BecomeMainWindow CanBecomeKeyWindow CanBecomeMainWindow CanHide Center CenterAndShow Close ContentMaxSize ContentMinSize ContentRectForFrameRect ContentSize ContentView ConvertBaseToScreen DefaultButtonCell Delegate Deminiaturize DisableKeyEquivalentForDefaultButtonCell DisplayIfNeeded DocumentIcon EnableKeyEquivalentForDefaultButtonCell FirstResponder Frame FrameRectForContentRect HasShadow Height Hide HidesOnDeactivate InitialFirstResponder IsKeyWindow IsMainWindow IsMiniaturized IsVisible IsZoomed MakeFirstResponder MakeKeyAndOrderFront MakeKeyWindow MakeMainWindow MaxSize MinFrameWidthWithTitle MinSize Miniaturize MovableByWindowBackground Move Opaque OrderBack OrderFront OrderFrontRegardless RecalculateKeyViewLoop ReleasedWhenClosed RunToolbarCustomizationPalette SelectKeyViewFollowingView SelectKeyViewPrecedingView SelectNextKeyView SelectPreviousKeyView SendAction SetToolbar Show ShowsResizeIndicator ShowsToolbarButton StyleMask Title Toolbar Visible Width WindowDidBecomeKey WindowDidBecomeMain WindowDidDeminiaturize WindowDidMiniaturize WindowDidMove WindowDidResignKey WindowDidResignMain WindowDidResize WindowWillClose WindowWillMiniaturize WindowWillMove WindowWillResize X Y Zoom


Properties

Property AcceptsMouseMovedEvents As Boolean

Property AllowsToolTipsWhenApplicationIsInactive As Boolean

Property AlphaValue As Double

Property BackgroundColor As NSColor

Property CanHide As Boolean

Property ContentMaxSize As Size

Property ContentMinSize As Size

Property ContentSize As Size

Property ContentView As NSView

Property DefaultButtonCell As NSButtonCell

Property Delegate As id

Property DocumentIcon As NSImage

Property Frame As Rect

Property HasShadow As Boolean

Property Height As Integer

Property HidesOnDeactivate As Boolean

Property InitialFirstResponder As NSView

Property MaxSize As Size

Property MinSize As Size

Property MovableByWindowBackground As Boolean

Property Opaque As Boolean

Property ReleasedWhenClosed As Boolean

Property ShowsResizeIndicator As Boolean

Property ShowsToolbarButton As Boolean

Property StyleMask As Integer

Property Title As String

Property Visible As Boolean

Property Width As Integer

Property X As Integer

Property Y As Integer



Subs & Functions

Sub Append(Argument As NSView)

Sub Center()

Sub CenterAndShow()

Sub Close()

Function ContentRectForFrameRect(Frame As Rect) As Rect

Function ConvertBaseToScreen(Argument As Point) As Point

Sub Deminiaturize()

Sub DisableKeyEquivalentForDefaultButtonCell()

Sub DisplayIfNeeded()

Sub EnableKeyEquivalentForDefaultButtonCell()

Function FirstResponder() As NSResponder

Function FrameRectForContentRect(Frame As Rect) As Rect

Sub Hide()

Function IsKeyWindow() As Boolean

Function IsMainWindow() As Boolean

Function IsMiniaturized() As Boolean

Function IsVisible() As Boolean

Function IsZoomed() As Boolean

Function MakeFirstResponder(Argument As NSResponder) As Boolean

Sub MakeKeyAndOrderFront()

Sub MakeKeyWindow()

Sub MakeMainWindow()

Function MinFrameWidthWithTitle(Title As String) As Integer

Sub Miniaturize()

Sub Move(Argument As Point)

Sub OrderBack()

Sub OrderFront()

Sub OrderFrontRegardless()

Sub RecalculateKeyViewLoop()

Sub RunToolbarCustomizationPalette()

Sub SelectKeyViewFollowingView(Following As NSView)

Sub SelectKeyViewPrecedingView(Preceding As NSView)

Sub SelectNextKeyView()

Sub SelectPreviousKeyView()

Function SendAction(Argument As id) As Boolean

Sub SetToolbar(Argument As NSToolbar)

Sub Show()

Function Toolbar() As id

Sub Zoom()



Events

Event BecomeKeyWindow(notification As NSNotification)

Event BecomeMainWindow(notification As NSNotification)

Event CanBecomeKeyWindow(notification As NSNotification)

Event CanBecomeMainWindow(notification As NSNotification)

Event WindowDidBecomeKey(notification As NSNotification)

Event WindowDidBecomeMain(notification As NSNotification)

Event WindowDidDeminiaturize(notification As NSNotification)

Event WindowDidMiniaturize(notification As NSNotification)

Event WindowDidMove(notification As NSNotification)

Event WindowDidResignKey(notification As NSNotification)

Event WindowDidResignMain(notification As NSNotification)

Event WindowDidResize(notification As NSNotification)

Event WindowWillClose(notification As NSNotification)

Event WindowWillMiniaturize(notification As NSNotification)

Event WindowWillMove(notification As NSNotification)

Event WindowWillResize(window As NSWindow, toSize As NSSize, proposedFrameSize As NSSize)



Class NSWindowController

Super Classes

NSResponder NSObject




























































































Controls

Control Array

Super Classes

Control NSArray NSObject

Overview

Append Insert Remove RemoveAll RemoveObject Replace


Subs & Functions

Sub Append(Argument As id)

Sub Insert(Argument As id, Index As Integer)

Sub Remove(Index As Integer)

Sub RemoveAll()

Sub RemoveObject(Argument As id)

Sub Replace(Argument As id, Index As Integer)



Control BevelButton

Super Classes

Control NSButton NSControl NSView NSResponder NSObject


Control CheckBox

Super Classes

Control NSButton NSControl NSView NSResponder NSObject


Control CircularProgressIncicator

Super Classes

Control NSProgressIndicator NSView NSResponder NSObject


Control CircularSlider

Super Classes

Control NSSlider NSControl NSView NSResponder NSObject


Control CustomView

Super Classes

Control NSView NSResponder NSObject


Control Data

Super Classes

Control NSData NSObject


Control DisclosureButton

Super Classes

Control NSButton NSControl NSView NSResponder NSObject


Control DisclosureTriangle

Super Classes

Control NSButton NSControl NSView NSResponder NSObject


Control GradientButton

Super Classes

Control NSButton NSControl NSView NSResponder NSObject


Control HelpButton

Super Classes

Control NSButton NSControl NSView NSResponder NSObject


Control HorizontalLine

Super Classes

Control NSBox NSView NSResponder NSObject


Control HorizontalSplitView

Super Classes

Control NSSplitView NSView NSResponder NSObject


Control IndeterminateProgressIncicator

Super Classes

Control NSProgressIndicator NSView NSResponder NSObject


Control Label

Super Classes

Control NSTextField NSControl NSView NSResponder NSObject


Control OBBackgroundView

Super Classes

Control NSView NSResponder NSObject

Overview

SetBackgroundImage


Subs & Functions

Sub SetBackgroundImage(Image As NSImage, Alpha As Single)



Control OBPreferences

Super Classes

Control NSObject


Control OBTask

Super Classes

Control NSTask NSObject

Overview

Arguments CurrentDirectory Environment ExitStatus IsRunning LaunchAndWait PID Path Resume StartAndWait Stop Suspend stdin


Properties

Property Arguments As Array

Property CurrentDirectory As String

Property Environment As Dicitonary

Property PID As Integer

Property Path As String



Subs & Functions

Function ExitStatus() As Boolean

Function IsRunning() As Boolean

Sub LaunchAndWait()

Function Resume() As Boolean

Sub StartAndWait(SetFrontProcess As Boolean)

Sub Stop()

Function Suspend() As Boolean



Events

Event stdin(Argument As Data)



Control OBTextView

Super Classes

Control NSTextView NSText NSView NSResponder NSObject

Overview

AutoFormat Breakpoints Commands Comment FileName FindNext FindPrevious FindReplace FindReplaceAll FindReplaceFind FindSetOptionIgnoreCase FindSetOptionSelectedTextOnly GotoLine Keywords Line LineSeparators Load Lowercase PerformSyntaxHighlighting Position PrintShowingPrintPanel Save ShiftLeft ShiftRight ToggleBreakpoint TurnOffWrapping TurnOnAutoIndent Types Uncomment Uppercase


Properties

Property Breakpoints As Array

Property Commands As Array

Property FileName As String

Property Keywords As Array

Property LineSeparators As Array

Property Types As Array



Subs & Functions

Sub AutoFormat()

Sub Comment()

Function FindNext(Text As String) As Boolean

Function FindPrevious(Text As String) As Boolean

Function FindReplace(Text As String) As Boolean

Function FindReplaceAll(Old As String, New As String) As Integer

Function FindReplaceFind(Old As String, New As String) As Boolean

Sub FindSetOptionIgnoreCase(IgnoreCase As Boolean)

Sub FindSetOptionSelectedTextOnly(SelectedTextOnly As Boolean)

Sub GotoLine(Line As Integer)

Function Line() As Integer

Function Load(Path As String) As Boolean

Sub Lowercase()

Sub PerformSyntaxHighlighting()

Function Position() As Integer

Sub PrintShowingPrintPanel(ProjectName As String, ProjectFile As String, Flag As Boolean)

Function Save(Path As String) As Boolean

Sub ShiftLeft()

Sub ShiftRight()

Sub ToggleBreakpoint()

Sub TurnOffWrapping()

Sub TurnOnAutoIndent()

Sub Uncomment()

Sub Uppercase()



Control Point

Super Classes

Control

Overview

X Y


Properties

Property X As Integer

Property Y As Integer



Control PushButton

Super Classes

Control NSButton NSControl NSView NSResponder NSObject


Control RadioButton

Super Classes

Control NSButton NSControl NSView NSResponder NSObject


Control Range

Super Classes

Control

Overview

Length Location


Properties

Property Length As Integer

Property Location As Integer



Control RecessedButton

Super Classes

Control NSButton NSControl NSView NSResponder NSObject


Control Rect

Super Classes

Control

Overview

Origin Size


Properties

Property Origin As Point

Property Size As Size



Control RoundButton

Super Classes

Control NSButton NSControl NSView NSResponder NSObject


Control RoundedRectButton

Super Classes

Control NSButton NSControl NSView NSResponder NSObject


Control RoundedTexturedButton

Super Classes

Control NSButton NSControl NSView NSResponder NSObject


Control Size

Super Classes

Control

Overview

Height Width


Properties

Property Height As Integer

Property Width As Integer



Control SquareButton

Super Classes

Control NSButton NSControl NSView NSResponder NSObject


Control String

Super Classes

Control


Control TexturedButton

Super Classes

Control NSButton NSControl NSView NSResponder NSObject


Control VerticalLine

Super Classes

Control NSBox NSView NSResponder NSObject


Control VerticalSplitView

Super Classes

Control NSSplitView NSView NSResponder NSObject




























































































Keywords

Keyword </string>


Keyword <string>


Keyword Action


See also IBAction

Keyword Alias

Declare statements: Used to extend the language and gain direct access to the Cocoa library or other Objective-C files of the current project.

Keyword As

Dim VARIABLENAME As VARIABLETYPE
Sub SUBNAME(ByRef VARIABLENAME As VARIABLETYPE)

It is used whenever you declare variables. After As, you write the type of the variable you currently declare. See the manual for more information on this.

See also Dim

Keyword AsRef


Keyword Break

Immediatily leaves the current loop.

Keyword ByRef

Sub SUBNAME(ByRef VARIABLENAME As VARIABLETYPE)

Defines the given variable to the sub or function, to be handled by reference. This means, that chaning the value of this varialbe affects the original variable as well. See the manual for more information on this.

Keyword ByVal

Sub SUBNAME(ByVal VARIABLENAME As VARIABLETYPE)

Defines the given variable to the sub or function, to be handled by value. This means, that chaning the value of this varialbe DOES NOT affect the original variable as well. See the manual for more information on this.

Keyword Call


Keyword Case

Select Case EXPRESSION...Case EXPRESSION...End Select
Select Case EXPRESSION...Case EXPRESSION To EXPRESSION...End Select
Select Case EXPRESSION...Case Is OPERATOR EXPRESSION...End Select
Select Case EXPRESSION...Case Else...End Select

It is used for Select Case, which introduces a multi-line conditional selection statement.

Dim i As Double
Dim n As Integer

i = 4

Select Case i
Case 0
n = 0
Case 1, 2
n = 1122
Case 4 To 10
n = 441000
Case Is = 9
n = 9999
Case Else
n = 999999
End Select


See also Select

Keyword Catch


Keyword Class

Classes are needed, when you would like use (custom) objects.

Keyword Const

Const NAME [As TYPE] = EXPRESSION

Declares a constants.
Constants are similar to variables but they cannot change values. When you declare a constant you assign a value to it that annot be altered during lifetime of your program.

Sub Namer()
Const pi = 3.14
MsgBox(pi)
End Sub

Sub test
Dim k As Integer

k = 9 + 23
MsgBox(k)
End Sub

Const a = 123.88 * 2, bb = 6
Const k As Integer = 2

Sub test2()
Dim i As Double
i = bb
test
' a = i ' would cause a parser error
End Sub


See also Dim

Keyword Continue

Immediatily tests loop condition of the current loop.

Keyword Declare

Used to extend the language and gain direct access to the Cocoa library or other Objective-C files of the current project.

Keyword Delegate


Keyword Dim

Dim VARIABLENAME [As VARIABLETYPE] {[, VARIABLENAME [As VARIABLETYPE]]}

Before using variables, you must declare them. You must define the name and the data type of a variable. The 'Dim'-statement declares a variable. See the manual for more information.

See also Const

Keyword Do

Do...Loop Until EXPRESSION
Do While EXPRESSION...Loop

Loop-statements

The statements that control decisions and loops in are called control structures. Normally every command is executed only one time but in many cases it may be useful to run a command several times until a defined state has been reached. Loops repeat commands depending upon a condition. Some loops repeat commands while a condition is 'True,' other loops repeat commands while a condition is 'False.' There are other loops repeating a fixed number of times and some repeat for all elements of a collection.
There are two different ways to use the keyword 'Do' in order to test a condition within a 'Do...Loop'-statement. You can test the condition before the commands inside the loop are executed or you can test the condition after the commands of the loop have been executed at least once. If the condition is 'True' ( in the following procedure 'SubBefore') the commands inside the loop execute.

Sub SubBefore()
Counter = 0
myNumber = 20
Do While myNumber > 10
myNumber = myNumber - 1
Counter = Counter + 1
Loop
MsgBox("Loop has been executed " & Counter & " time(s).")
End Sub

Sub SubAfter()
Counter = 0
myNumber = 9
Do
myNumber = myNumber - 1
Counter = Counter + 1
Loop While myNumber > 10
MsgBox("Loop has been executed " & Counter & " time(s).")
End Sub


Keyword Else

If EXPRESSION Then...Else If EXPRESSION...Else...End If

A single decision is used to execute a set of statements if a condition is set ('If'-statement). If the condition is 'True' then the statements after the 'Then' are executed and the statements after the 'Else' are skipped. If the condition is 'False', the statements after the 'Else' are executed.

Dim i As Integer
Dim n As Integer

If i 1 Then
n = 11111
Else If i = 2 * 10 Then
n = 22222
Else
n = 33333
End If


See also If

Keyword End

End Sub
End Function
End Type
End Event
End Enum
End Delegate
End Action
End IBAction
End If
End Select

It is used to close the current sub, function or other language structure. See the list above.

Keyword Enum

Used to gain access to native Cocoa enums (use it with declare statements)

Keyword Event

Events are automatically called by the runtime. The difference between events and actions is that events are overriding the super class event function.

Keyword Exception


Keyword Exit

Exit For

Explicit leave of for loop. Note: That Exit For works only within non-nested code.

Exit Do

Explicit leave of do loop. Note: That Exit For works only within non-nested code.

Exit Sub

Explicit leave of sub.

Exit Function

Explicit leave of function.

Exit Event

Explicit leave of event procedure.

Exit Delegate

Explicit leave of delegate procedure.

Exit IBAction

Explicit leave of IBAction procedure.

Sub doingSomething()

MsgBox("did something")

Exit Sub

MsgBox("end of sub")

For i As Integer = 1 To 11
Exit For
MsgBox("xyz")
Next

End Sub

Function doingSomething2()

MsgBox("did something")

Exit Function

MsgBox("end of function")

End Function


Keyword False

The boolean literal used for the false value.

See also True

Keyword Finally


Keyword For

For VARIABLENAME = EXPRESSION To EXPRESSION [Step EXPRESSION]
Next

The statements that control decisions and loops are called control structures. Normally every command is executed only one time but in many cases it may be useful to run a command several times until a defined state has been reached. Loops repeat commands depending upon a condition. Some loops repeat commands while a condition is 'True', other loops repeat commands while a condition is 'False'. There are other loops repeating a fixed number of times and some repeat for all elements of a collection. The For-Next loop is useful when you know how often statements should be repeated. For-Next defines a loop that runs a specified number of times.

Dim ctr As Integer

For ctr = 1 To 5
MsgBox("Z", i)
Next


See also Next

Keyword Framework


Keyword Function

Function NAME([ARGUMENTS]) [As RETURNTYPE]...End Function

Is a part of a program, returning a value depending on calculation inside the function. A function-procedure can have arguments, variables, expressions, or constants that are given to it when it get called. Function-procedures return values.

' function example

Function divide(dividend As Float, divisor As Float) As Float

Return dividend / divisor

End Function

Sub Main()
MsgBox(divide(18, 9))
End Sub


See also Sub

Keyword Global

Global Dim VARIABLENAME [As VARIABLETYPE] [= EXPRESSION]

Unlike other variables and procedures of a file, global variables and procedures can be access just by its name only.

See also Dim, Public

Keyword GoTo

GoTo LABEL

Unconditional jumping
Programmers can also use unconditional branches. This type of branching can be performed using the 'GoTo'-instruction. 'GoTo' forces program execution to branch to a specific line number or label. Because line numbers are now obsolete, you do not have to worry about how to use them. You may, however, want to use labels. 'GoTo' performs a unconditional jump. 'GoTo' is always executed, without a condition.

Sub test()
Dim b As Integer
Dim n As Integer

b = 45
GoTo bernd
b = 99999
bernd :

n = 0
ok :
n = n + 1
If n < 5 Then GoTo ok
End Sub


Keyword IBAction


Keyword IBOutlet


Keyword IIf

IIf(EXPRESSION, THENRETURNEXPRESSION, ELSERETURNEXPRESSION)

IIf returns a value of two values depending on an expression.

Function testing(Test1 As Integer) As String
Return IIf(Test1 > 1000, "big", "small")
End Function

Sub Main()
MsgBox(testing(5))
MsgBox(testing(5555))
End Sub


Keyword If

A single decision is used to execute a set of statements if a condition is set ('If'-statement). If the condition is 'True' then the statements after the 'Then' are executed and the statements after the 'Else' are skipped. If the condition is 'False', the statements after the 'Else' are executed.

See also Then, Else

Keyword Is

Select Case EXPRESSION...Case Is OPERATOR EXPRESSION...End Select

Used in a select case statement for comparision.

Keyword Iterate

Iterate For

Manually test loop condition for a 'For'-loop. Note: That Iterate For works only within non-nested code.

Iterate Do

Manually test loop condition of a 'Do'-loop. Note: That Iterate Do works only within non-nested code.

Keyword Loop

Do
Loop Until EXPRESSION
Do While EXPRESSION
Loop

Loop-statements. See Do fore more information.

Keyword Me

Use current instance or object. The keyword 'Me' references the current instance (or object) in which the code is currently executed. Normally it is the current class (user defined class or form class).

Keyword Mid

Mid(STRINGVARIABLE, Position As Integer, Length As Integer) = {STRINGEXPRESSION | ASCII-Code}

Replaces text inside a string by another text.

Sub Main()
Dim txt As String, replacement As String, originaltxt As String

replacement = "The power of Q7Basic"
originaltxt = "***********************"
Dim i As Integer
For i = 1 To Len(replacement)
Mid(originaltxt, 2, i) = replacement
MsgBox(originaltxt)
Next
End Sub


Keyword Module

Modules are usefull when you would like to organize functions and subs. A simple application can consist of only one form while the complete source code is in one form module. As your applications grow larger you probably would like to use the same code at different places. To do so, place this code in a global module file as it is accessible by the entire application. You code is stored in classes or modules. You can archive your code within modules. Every module consists of the declaration part and the procedures you have inserted. A module can contain: Declarations - for variables, types, enumerations and constants; Procedures - which are not assigned to a special event or object.
You can create as many procedures as you want, e.g. sub-procedures without return value or function-procedures. You must not put several classes or modules in one file.
See the manual for more information.

See also Class

Keyword Next

For VARIABLENAME = EXPRESSION To EXPRESSION [Step EXPRESSION]
Next

The statements that control decisions and loops are called control structures. Normally every command is executed only one time but in many cases it may be useful to run a command several times until a defined state has been reached. Loops repeat commands depending upon a condition. Some loops repeat commands while a condition is 'True', other loops repeat commands while a condition is 'False'. There are other loops repeating a fixed number of times and some repeat for all elements of a collection. The For-Next loop is useful when you know how often statements should be repeated. For-Next defines a loop that runs a specified number of times.

Dim ctr As Integer

For ctr = 1 To 5
MsgBox("Z", i)
Next


See also For

Keyword Nil


Keyword No

The boolean literal used for the false value.

See also Yes

Keyword Null


Keyword Private

Private VARIABLENAME[ARRAY] [As VARIABLETYPE] [, VARIABLENAME[ARRAY] [As VARIABLETYPE]]

Before using variables, you must declare them. You must define the name and the data type of a variable. Use of the 'Private'-Statement Use the 'Private'-statement to declare private variables in module scope or class scope, making the variable accessible only from the same scope (module scope, all module procedures, class scope, all class methods)
See the manual for more information.

See also Class, Module, Dim, Public, Global

Keyword Property

Defines a property

Keyword Public

Public VARIABLENAME[ARRAY] [As VARIABLETYPE] [, VARIABLENAME[ARRAY] [As VARIABLETYPE]]

You can use the 'Public'-statement to declare public variables in module scope or class scope, making the variable accessible from everywhere.
See the manual for more information.

See also Class, Module, Dim, Private, Global

Keyword Return

Return [EXPRESSION]

Returns a value (for functions only) and leaves the current function/sub.

Keyword Select

Select Case EXPRESSION...Case EXPRESSION...End Select
Select Case EXPRESSION...Case EXPRESSION To EXPRESSION...End Select
Select Case EXPRESSION...Case Is OPERATOR EXPRESSION...End Select
Select Case EXPRESSION...Case Else...End Select

It is used for Select Case, which introduces a multi-line conditional selection statement.

Dim i As Double
Dim n As Integer

i = 4

Select Case i
Case 0
n = 0
Case 1, 2
n = 1122
Case 4 To 10
n = 441000
Case Is = 9
n = 9999
Case Else
n = 999999
End Select


See also Case

Keyword Static

Static Dim VARIABLENAME[ARRAY] [As VARIABLETYPE] [, VARIABLENAME[ARRAY] [As VARIABLETYPE]]

Before using variables, you must declare them. You must define the name and the data type of a variable. Static is a modifier to declare variables with a special feature: Static outside a class, but inside a procedure (sub or function) or method. If you use a 'Static'-statement instead of a 'Dim'-statement, the variable is declared as local static variable. The variable, once it has been declared, it is not destroyed by leaving the procedure. The next time the procedure is entered, the value of the variable still exists. Therefore, a local static variable is only one time declared when using recursive calls of a procedure.

Sub test()
Static Dim i As Integer = 0
MsgBox(i)
i = i + 1 ' this value is not lost after the sub exited
End Sub

Sub Main()
test()
test()
test()
End Sub


Keyword Step

Enables you to control the value of increment or decrement of a loop counter variable of a For-Next-Loop.

Keyword Sub

Sub SUBNAME(ARGUMENTS)...End Sub

Is a part of your program containing commands. A sub-procedure can have arguments, variables, expressions, or constants that are given to the sub-procedure when calling it.

' sub example

Sub theMusic()
MsgBox("represents cuba")
MsgBox("your hips make a shift...")
MsgBox("I'm the one to find you in the mood...")
MsgBox("CUBA!")
MsgBox("represents cuba")
MsgBox("represents cuba")
End Sub

Sub Main()
theMusic() ' first use of sub
theMusic() ' 2nd use
theMusic() ' 3rd use
End Sub


See also Function

Keyword Super

Reserved.

Keyword SuperClass


Keyword Then

If EXPRESSION Then...Else If EXPRESSION...Else...End If

A single decision is used to execute a set of statements if a condition is set ('If'-statement). If the condition is 'True' then the statements after the 'Then' are executed and the statements after the 'Else' are skipped. If the condition is 'False', the statements after the 'Else' are executed.

Dim i As Integer
Dim n As Integer

If i 1 Then
n = 11111
Else If i = 2 * 10 Then
n = 22222
Else
n = 33333
End If


Keyword Then

If EXPRESSION Then...Else If EXPRESSION...Else...End If

A single decision is used to execute a set of statements if a condition is set ('If'-statement). If the condition is 'True' then the statements after the 'Then' are executed and the statements after the 'Else' are skipped. If the condition is 'False', the statements after the 'Else' are executed.

Dim i As Integer
Dim n As Integer

If i 1 Then
n = 11111
Else If i = 2 * 10 Then
n = 22222
Else
n = 33333
End If


Keyword To

For VARIABLENAME = EXPRESSION To EXPRESSION [Step EXPRESSION]
Next

The statements that control decisions and loops are called control structures. Normally every command is executed only one time but in many cases it may be useful to run a command several times until a defined state has been reached. Loops repeat commands depending upon a condition. Some loops repeat commands while a condition is 'True', other loops repeat commands while a condition is 'False'. There are other loops repeating a fixed number of times and some repeat for all elements of a collection. The For-Next loop is useful when you know how often statements should be repeated. For-Next defines a loop that runs a specified number of times.

Dim ctr As Integer

For ctr = 1 To 5
MsgBox("Z", i)
Next


Keyword True

The boolean literal used for the true value.

See also False

Keyword Try


Keyword Until

Do
Loop Until EXPRESSION
Do While EXPRESSION
Loop

The statements that control decisions and loops are called control structures. Normally every command is executed only one time but in many cases it may be useful to run a command several times until a defined state has been reached. Loops repeat commands depending upon a condition. Some loops repeat commands while a condition is 'True,' other loops repeat commands while a condition is 'False.' There are other loops repeating a fixed number of times and some repeat for all elements of a collection.
Use the following loops when you are not sure how often a command should be repeated: 'Do', 'While', 'Loop'or 'Until'. There are two different ways to use the keyword 'While' in order to test a condition within a 'Do
Loop'-statement. You can test the condition before the commands inside the loop are executed or you can test the condition after the commands of the loop have been executed at least once. If the condition is 'True' ( in the following procedure 'SubBefore') the commands inside the loop execute.

Sub SubBefore()
Counter = 0
myNumber = 20
Do While myNumber > 10
myNumber = myNumber - 1
Counter = Counter + 1
Loop
MsgBox("Loop has been executed " & Counter & " time(s).")
End Sub

Sub SubAfter()
Counter = 0
myNumber = 9
Do
myNumber = myNumber - 1
Counter = Counter + 1
Loop While myNumber > 10
MsgBox("Loop has been executed " & Counter & " time(s).")
End Sub


Keyword Var

Var is an alias for Dim

See also Var

Keyword While

While...End While

Do While EXPRESSION
Loop

Loop-statement. See Do fore more information.

Keyword Yes

The boolean literal used for the true value.

See also No


























































































Types

Type Array

Alias for NSMutableArray.

Type Boolean

The boolean type. It is a wrapped BOOL inside of a NSNumber object.

Allowed values are 'Yes' (for true) or 'No' (for false).

Type Byte


Type Data

Alias for NSMutableData.

Type Dictionary

Alias for NSMutableDictionary.

Type Double


Type Float


Type Integer

It is 32 bit on 32 bit systems and 64 bit on 64 bit systems.

Type Long

Reserved.

Type Point


Type Range


Type Rect

The rect type defines a rect. It is a wrapped NSRect inside of a NSValue object.

Contains the properties Origin As Point and Size As Size.

Type Short


Type Single


Type Size


Type String

Alias for NSMutableString.

Type id

Almost an alias for NSObject.



























































































Constants

Constant ArrowCursor


Constant BlackColor


Constant BlueColor


Constant BrownColor


Constant CaseInsensitive


Constant CaseSensitive


Constant ClearColor


Constant ClosedHandCursor


Constant CrosshairCursor


Constant CurrentCursor


Constant CyanColor


Constant DarkGrayColor


Constant DisappearingItemCursor


Constant GrayColor


Constant GreenColor


Constant IBeamCursor


Constant LightGrayColor


Constant MagentaColor


Constant NSAlertFirstButtonReturn


Constant NSAlertSecondButtonReturn


Constant NSAlertThirdButtonReturn


Constant NSAlternateKeyMask


Constant NSBezelBorder


Constant NSBorderlessWindowMask


Constant NSBoxCustom


Constant NSBoxOldStyle


Constant NSBoxPrimary


Constant NSBoxSecondary


Constant NSBoxSeparator


Constant NSCenterTextAlignment


Constant NSCircularBezelStyle


Constant NSClosableWindowMask


Constant NSCommandKeyMask


Constant NSControlKeyMask


Constant NSDisclosureBezelStyle


Constant NSDownArrowFunctionKey


Constant NSFocusRingTypeDefault


Constant NSFocusRingTypeExterior


Constant NSFocusRingTypeNone


Constant NSGrooveBorder


Constant NSHelpButtonBezelStyle


Constant NSHighlightModeMatrix


Constant NSImageAbove


Constant NSImageBelow


Constant NSImageLeft


Constant NSImageOnly


Constant NSImageOverlaps


Constant NSImageRight


Constant NSJustifiedTextAlignment


Constant NSLeftArrowFunctionKey


Constant NSLeftTextAlignment


Constant NSLineBorder


Constant NSListModeMatrix


Constant NSMiniaturizableWindowMask


Constant NSMixedState


Constant NSMomentaryChangeButton


Constant NSMomentaryLight


Constant NSMomentaryLightButton


Constant NSMomentaryPushButton


Constant NSMomentaryPushInButton


Constant NSNaturalTextAlignment


Constant NSNoBorder


Constant NSNoImage


Constant NSOffState


Constant NSOnOffButton


Constant NSOnState


Constant NSOrderedAscending


Constant NSOrderedDescending


Constant NSOrderedSame


Constant NSPushOnPushOffButton


Constant NSRadioButton


Constant NSRadioModeMatrix


Constant NSRecessedBezelStyle


Constant NSRegularSquareBezelStyle


Constant NSResizableWindowMask


Constant NSRightArrowFunctionKey


Constant NSRightTextAlignment


Constant NSRoundRectBezelStyle


Constant NSRoundedBezelStyle


Constant NSRoundedDisclosureBezelStyle


Constant NSScaleNone


Constant NSScaleProportionally


Constant NSScaleToFit


Constant NSShadowlessSquareBezelStyle


Constant NSShiftKeyMask


Constant NSSmallSquareBezelStyle


Constant NSSwitchButton


Constant NSTableColumnAutoresizingMask


Constant NSTableColumnNoResizing


Constant NSTableColumnUserResizingMask


Constant NSTableViewGridNone


Constant NSTableViewSolidHorizontalGridLineMask


Constant NSTableViewSolidVerticalGridLineMask


Constant NSTextFieldRoundedBezel


Constant NSTextFieldSquareBezel


Constant NSTexturedBackgroundWindowMask


Constant NSTexturedRoundedBezelStyle


Constant NSTexturedSquareBezelStyle


Constant NSThickSquareBezelStyle


Constant NSThickerSquareBezelStyle


Constant NSTitledWindowMask


Constant NSToggleButton


Constant NSToolbarCustomizeToolbarItemIdentifier


Constant NSToolbarDisplayModeDefault


Constant NSToolbarDisplayModeIconAndLabel


Constant NSToolbarDisplayModeIconOnly


Constant NSToolbarDisplayModeLabelOnly


Constant NSToolbarFlexibleSpaceItemIdentifier


Constant NSToolbarSeparatorItemIdentifier


Constant NSToolbarSizeModeDefault


Constant NSToolbarSizeModeRegular


Constant NSToolbarSizeModeSmall


Constant NSToolbarSpaceItemIdentifier


Constant NSTrackModeMatrix


Constant NSUpArrowFunctionKey


Constant NSViewHeightSizable


Constant NSViewMaxXMargin


Constant NSViewMaxYMargin


Constant NSViewMinXMargin


Constant NSViewMinYMargin


Constant NSViewNotSizable


Constant NSViewWidthSizable


Constant OpenHandCursor


Constant OrangeColor


Constant PointingHandCursor


Constant PurpleColor


Constant RedColor


Constant ResizeDownCursor


Constant ResizeLeftCursor


Constant ResizeLeftRightCursor


Constant ResizeRightCursor


Constant ResizeUpCursor


Constant ResizeUpDownCursor


Constant WhiteColor


Constant YellowColor




























































































Operators

Operator !


Operator $


Operator &


Operator '


Operator (


Operator )


Operator *


Operator +


Operator -


Operator .


Operator /


Operator :


Operator <=


Operator <>


Operator =


Operator =


Operator ==


Operator ===


Operator >=


Operator And

And operator

Operator AndAlso


Operator Flip


Operator Mod


Operator Not


Operator Or


Operator OrElse


Operator Shl


Operator Shr


Operator Xor


Operator \


Operator ^






























































































(C)opyright KBasic Software 2009-2011. All right reserved.