Visual MacStandardBasic 4.0 Reference Manual

Visual MacStandardBasic 4.0 User's Guide

Visual MacStandardBasic 4.0 Tutorial

Visual MacStandardBasic 4.0
Quick Reference

 Execution Control
Forms and Windows
Controls
Menus
System and Desktop
Graphic Drawing Commands

Animation
QuickTime Movies
Speech
Sound
File I/O
Printing

Serial Ports
Math Functions
String Functions
Date and Time
Memory Buffers
Error Handling
Console Text Window

Events
Direct Memory Access
Direct Mouse Access
Direct Keyboard Access

Code Resource Modules
Links above will jump to the section on this page

Execution Control

Command Summary:


Forms & Windows

Command Summary:
Form formName
Window
var, left, top, width, height, title$, windowType, Sub
WinSize
windowID, width, height
WinMove
windowID, left, top
WinTitle
windowID, title$
WinClose
windowID
WinHide
windowID
WinShow
windowID
WinRedraw
windowID
WinOrigin
windowID, left, top
WinClip
windowID, left, top, width, height
LoadPalette
palette#, resourceID
WinPalette
windowID, palette#
ClearWindow
windowID
ClearControls
windowID
ClearGraphics
windowID
AlertBox
resourceID

Function Summary:
var = WinBorder ( windowID, dimension )
var = WinHandle ( windowID )
var = WinExist ( windowID )
var$ = WinTitle ( windowID )
var$ = FrontWindow ( )
var = WinNum ( windowID )
var = MsgBox( message$, buttontypes )


Controls

Command Summary:
Button var, window#, left, top, width, height, text$, Sub
Checkbox var, window#, left, top, width, height, text$, Sub
Radio
var, window#, left, top, width, height, text$, Sub
TextBox
var, window#, left, top, width, height, text$, Sub
TextBoxRO
control#, status
TextSelect
control#, startOffset, endOffset
Label
var, window#, left, top, width, height, text$, Sub
DropList
var, window#, left, top, width, Sub
ListBox
var, window#, left, top, width, height, option, Sub
ListClear
control#
ListAdd
control#, text$
ListRemove
control#, item#
Scroll
var, window #, left, top, width, height, Sub
ScrollSet
control#, min, max, pageValue
Picture
var, window #, left, top, width, height, ResourceID, Sub
Icon
var, window #, left, top, ResourceID, Sub
Timer
var, windowID, interval, enabledFlag, Sub
CtlValue
control#, value
CtlText
control#, text$, options
CtlHilite
control#
CtlRemove
control#
CtlHide
control#
CtlShow
control#
CtlDisable
control#
CtlEnable control#
CtlSize
control#, width, height
CtlMove
control#, left, top

Function Summary:
var = TextLen ( control# )
var = TextStart ( control# )
var = TextEnd ( control# )
var$ = TextSelect ( control# )
var = ClipAvail( )
var = ListCount ( control# )
var = ListNumSel ( control# )
var$ = ListItem ( control#, item# )
var$ = ListSelect ( control#, item# )
var = CtlValue ( control# )
var$ = CtlText ( control# )
var = CtlExist ( control# )
var = CtlNum ( control# )
var$ = CtlBroder ( control#, dimension )


Menus

Command Summary:
MenuAdd menu
#, title$, Sub
MenuAddItem menu#, text$, cmdLetter$, Sub
MenuApple
MenuBlank
MenuClear
MenuDelete
menu#
MenuDeleteItem menu#, menuitem#
MenuDesk
MenuDisable
menu#, menuitem#
MenuEnable menu#, menuitem#
MenuFonts menu#
MenuInsertItem menu#, menuitem#, text$, cmdLetter$, Sub
MenuMark menu#, menuitem#, mark
MenuRedraw
MenuText
menu#, menuitem#, text$
SubMenu var, menu#, menuItem#, Sub

Function Summary:
var = MenuCount ( menu# )
var = MenuMark ( menu#, menuitem# )
var$ = MenuText ( menu#, menuitem# )


System & Desktop

Command Summary:
SetCursor CursorID
HideCursor
ShowCursor
SetDepth
colorDepth

Function Summary:
var = GetDepth ( )
var = HasDepth ( colorDepth )
var = Launch( pathname$ )
var = ScreenBorder ( dimension )
var = PowerPC ( )
var$ = AppPath( )


Graphic Drawing Commands

Command Summary:
DrawText windowID, x, y, text$
DrawFont
windowID, fontNum
DrawSize
windowID, fontSize
DrawStyle
windowID, fontStyle
Point
windowID, x, y
MoveTo
windowID, x, y
LineTo
windowID, x, y
Line
windowID, x1, y1, x2, y2
Box
windowID, x, y, width, height
BoxFill
windowID, x, y, width, height
Circle
windowID, x, y, radius
CircleFill
windowID, x, y, radius
Ellipse
windowID, x, y, width, height
EllipseFill
windowID, x, y, width, height
StretchLine
windowID, x, y, var1, var2
StretchBox
windowID, x, y, var1, var2
StretchCircle
windowID, x, y, var
StretchEllipse
windowID, x, y, var1, var2
DrawPicture
windowID, left, top, width, height, ResourceID
SetColor windowID, color
SetColorRGB
windowID, redValue, greenValue, blueValue
BackColor
windowID, color
BackColorRGB
windowID, redValue, greenValue, blueValue
PenSize
windowID, width, height
PenPattern
windowID, pattern
PenMode windowID, mode
PenNormal windowID
DrawUpdate windowID, status
PictureBegin width, height
PictureDone
PictureSave
ResourceID

Function Summary:
var = PictureLoad ( pathname$ )
var = FontNum ( fontName$ )
var = GetPixel ( fontName$ )
var = RGB ( fontName$ )


Animation

Command Summary:
SpriteFrame var, windowID
SpriteEnd
SpriteBegin
FrameBufferID
SpriteDone
SpriteDisplay
FrameBufferID
SpriteLoad
var, ResID
SpriteUnload
spriteGfxID
SpriteDup
spriteGfxID1, spriteGfxID2
SpriteDraw
spriteGfxID, x, y, priority
SpriteCopy
spriteGfxID, x, y, priority
SpriteDrawSize
spriteGfxID, x, y, widthOffset, heightOffset, priority
SpriteCopySize spriteGfxID, x, y, widthOffset, heightOffset, priority
SpriteClear
FrameBufferID
SpriteClear spriteGfxID

Function Summary:
var = SpriteWidth ( spriteGfxID )
var = SpriteHeight ( spriteGfxID )
var = SpriteHit ( spriteGfxID, minLayer#, maxLayer# )


QuickTime Movies

Command Summary:
MovieOpen var, window, options, MovieFilename$
MoviePlay MovieID
MovieClose MovieID
MovieMove MovieID, x, y

Function Summary:
var = IsMovie ( )


Speech

Command Summary:
Say text$

Function Summary:
var = IsSpeech ( )
var = SpeechBusy( )


Sound

Command Summary:
Beep
SoundLoad
var, ResourceID
SoundUnload SndID
SoundPlay SndID

Function Summary:
var = SoundPlaying( SndID )
var = IsSound( )


File I/O

Command Summary:
Open var, mode, pathname$
Close
FileID
Create
pathname$, creator, filetype
CreateFolder
pathname$
Delete
pathname$
Rename oldPathname$, newName$
CopyFile
srcFilename$, destFilename$
Lock
pathname$
Unlock
pathname$
Write
FileID, text$
WriteBuffer
FileID, BufferID, StartLocation, NumberOfBytes
ReadBuffer
FileID, BufferID, StartLocation, NumberOfBytes
Seek
FileID, location

Function Summary:
var$ = OpenDialog ( fileTypes$ )
var$ = SaveDialog ( pathname$, prompt$ )
var$ = Read ( FileID, NumberOf Bytes )
var$ = LineInput ( FileID )
var = ReadBuffer( FileID, BufferID, StartLocation, NumberOfChars )
var = LOF ( FileID )
var$ = Dir ( pathname$ )
var = NumFiles ( pathname$ )
var$ = GetFilename ( pathname$, file# )
var = EOF ( FileID )
var = LOC ( FileID )
var = FileExist ( pathname$ )
var = FileName ( pathname$ )
var = FileSize ( pathname$ )
var = TypeCvt ( fileType$ )


Printing

Command Summary:
PrintOpen
PrintClose
NewPage

Function Summary:
var = PageSetup( )
var = PrintSetup( )


Serial Ports

Command Summary:
SerialOpen port#, baudrate, parity, databits, stopbits
SerialClose port#
SerWrite port# , text$
SerSet port#, baudrate, parity, databits, stopbits

Function Summary:
var = SerialCheck( port# )
var = SerialAvail ( port# )
var$ = SerRead ( port# )


Math Functions

Function Summary:
var = Abs ( numeric-expression )
var = Acos ( numeric-expression )
var = And( numeric-expression1, numeric-expression2 )
var = Asin ( numeric-expression )
var = Atan ( numeric-expression )
var = Cos ( numeric-expression )
var = DegToRad ( numeric-expression )
var = Exp( numeric-expression )
var = Int( numeric-expression )
var = Log ( numeric-expression )
var = Mod( numeric-expression1 , numeric-expression2 )
var = Or( numeric-expression1, numeric-expression2 )
var = Pi ( )
var = Power( numeric-expression1, numeric-expression2 )
var = RadToDeg ( numeric-expression )
var = Rnd( min, max )
var = Sin ( numeric-expression )
var = Sqr ( numeric-expression )
var = Tan ( numeric-expression )
var = Xor( numeric-expression1, numeric-expression2 )
var = Not ( numeric-expression )


String Functions

Function Summary:
var = Asc ( text$ )
var$ = Chr ( numeric-expression )
var$ = Left ( text$, numOfChars )
var$ = Right ( text$, numOfChars )
var$ = Mid ( text$, startPos, numOfChars )
var$ = Lcase ( text$ )
var$ = Ucase ( text$ )
var$ = Trim ( text$ )
var$ = Ltrim ( text$ )
var$ = Rtrim ( text$ )
var$ = Str ( numeric-expression )
var$ = Str ( numeric-expression , decimalPlaces)
var$ = Space ( length )
var$ = String ( length , charCode )
var = InStr ( searchString$, stringToSearch$, startpos , caseFlag )
var = Len ( text$ )
var = Val ( text$ )
var$ = Hex ( numeric-expression )
var$ = StrRes( ResID )
var = StrResLen( ResID )


Date and Time

Command Summary:
Delay ticks

Function Summary:
var$ = Date ( )
var$ = Time ( )
var = Timer ( )
var$ = Day ( date$ )


Memory Buffers

Command Summary:
MemAlloc var, size
MemResize
var, size
MemFree
BufferID
MemFill
BufferID, StartLocation, NumOfBytes, FillValue
MemInt
BufferID, Location, Int
MemLong
BufferID, Location, Long
MemSingle
BufferID, Location, Single
MemDouble
BufferID, Location, Double
MemString
BufferID, Location, text$

Function Summary:
var = MemInt( BufferID, Location )
var = MemLong( BufferID, Location )
var = MemSingle( BufferID, Location )
var = MemDouble( BufferID, Location )
var$ = MemString( BufferID, Location, Length)
var = MemSize( BufferID )


Error Handling

Command Summary:
OnError Sub

Function Summary:
var = ErrorNum( )
var$ = ErrorMsg ( )


Console Text Window

Command Summary:
Print [numeric-expression][,][text$][,][...][;]
?
[text$][;][numeric-expression][,][text$][,][...][;]
Input var
Console status
ConMsg status
ConClear
ConTitle
titleString$


Events

Command Summary:
Events status
SetCmdKey
char, Sub

Function Summary:
var = EventCode( code )


Direct Memory Access

Command Summary:
Poke memoryAddress, byteValue
PokeInt
memoryAddress, intValue
PokeLong
memoryAddress, longValue

Function Summary:
var = Peek( memoryAddress )
var = PeekInt( memoryAddress )
var = PeekLong( memoryAddress )
var = VarAddr( variable )


Direct Mouse Access

Function Summary:
var = MouseX( )
var = MouseY( )
var = MouseDown( )
var = EventMouseX( )
var = EventMouseY( )


Direct Keyboard Access

Function Summary:

var$ = GetKeys( )
var = KeysDown( )
var = IfKey( )


Code Resource Modules

Function Summary:
var = Call( longValue1, longValue2, longValue3, longValue4 )