Futurebasic/Language/Reference

From Wikibooks, open books for an open world
< Futurebasic‎ | Language
Jump to: navigation, search

Language Reference[edit]

#[edit]

#define newTypeName as oldTypeName
#define newTypeName as {Pointer to|@|^|.} oldTypeName
#define newTypeName as {Handle to|@@|^^|..} oldTypeName
#if condition

[statementBlock1]
[ #else
[statementBlock2]]
#endIf

functionAddress& = @fn functionName

A[edit]

positiveValue = abs (expr)
radianAngle# = acos (expr)
positiveResult# = acosh (expr)
result = exprA and | && expB
annuityFactor# = fn annuityY# (rate, periods)
appearance button [#] [-] id& [, [ state ] [, [ value ] [, [ min ] [, [ max ] [, [ title$ ] [, [ rect ] [, [ type ] ] ] ] ] ] ]
appearance window [#] [-] id& [, [ title$ ] [, [ rect ] [, [ windowClass ] [, [ windowAttributes ] [, [ FBAttributes ] ] ] ] ] ]
append [#] fileID
apple menu string$
string$ = AppleEventMessage$
ASCIIcode% = asc (string$)
ASCIIcode% = asc (container$$)
radianAngle# = asin(expr)
result# = asinh(expr)
radianAngle# = atan(expr)
result# = atanh(expr)
radianAngle# = atn(expr)
autoclip [=] booleanExpr /* Not Supported in FBtoC */

B[edit]

beep
begin enum [start [,inc]]
begin globals
begin record typeName
begin union
BeginAssem /* Not Supported in FBtoC */
binString$ = bin$ (expr)
bitValue = bit (bitPos)
BlockMove sourceAddr&, destinationAddr&, numberBytes&
box [ fill ] [h, v] to h1, v1 [ to h2, v2 ...]
buttonState = BUTTON [ (ID [, selector ]) ]
buttonHandle& = BUTTON& (btnID&|%)
BUTTON [#] btnID, state, title, btnRect [, btnType ]
BUTTON CLOSE [#] btnID
pString$ = FN BUTTONTEXTSTRING$ (bRefNum&)

C[edit]

[ CALL ] toolboxProcName [ modifiers ] [ ([ { #addrExpr1& | arg1 } [,{ #addrExpr2& | arg2 }...] ]) ]
CASE - See the SELECT CASE statement
character$ = CHR$ (expr)
CFINDEX.INCL
ignore = FN CFINDEXSORT (whichIndex)
CIRCLE [ FILL ] x, y, radius [ { TO | PLOT } startAngle, angleSize ]
CLEAR
CLEAR bytes& [, indexID ]
CLEAR numElements&, indexID, eltSize
CLEAR -1
CLEAR INDEX$ [ indexID ]
CLEAR LOCAL - See the LOCAL statement
CLEAR LPRINT
CLEAR
CLOSE FOLDER wdRefNum%
CLOSE LPRINT
CLS [ LINE | PAGE ]
COLOR WINDOW {_true | _false}
COLOR [=] colorExpr
COMPILE END IF - See the COMPILE LONG IF statement /* Not Supported in FBtoC. See #ENDIF */

COMPILE LONG IF condition /* Not Supported in FBtoC. See #IF */

[statementBlock1]
[ COMPILE XELSE
[statementBlock2] ]
COMPILE END IF

COMPILE SHUTDOWN "Optional Quoted Remark"
COMPILE [ tickCount ] [, compileFlags ]
COMPILE XELSE - See the COMPILE LONG IF statement /* Not Supported in FBtoC. See #ELSE */
flag& = COMPILEFLAGS (_compileConstant)
versionNum& = COMPILERVERSION
compoundFactor# = FN COMPOUND# (rate, periods)
COMPRESS DYNAMIC arrayName
Constant declaration : _constantName = staticExpr
COORDINATE WINDOW
theCosine# = COS (expr)
result# = COSH (expr)
currentLine = CSRLIN
CURSOR [=] intExpr (Standard BASIC)
CURSOR cursorID [, cursorType ] (Appearance Runtime)
var& = CVI (string$)

D[edit]

DATA item1 [, item2 ...]
dateString$ = DATE$
DEC (intVar)
DEC { LONG | WORD | BYTE } (addr&)
DEF APNDLNG (longExpr, handle&)
DEF APNDSTR (string$, STR#resourceHndl&)
DEF BLOCKFILL (startAddr&, numBytes&, byteValueExpr)
DEF BORDER (twoPixelBorder, { rect | #rectAddr& })
DEF BTNRECT ({ rect | #rectAddr& }, buttonID%)
DEF BUTTONHELPDISPLAY (bntID) /* Not Supported in FBtoC */
DEF BUTTONHELPSETTEXT (btnID%|&, helpMessage$)
DEF BUTTONHELPSHOW (showHideFlag)
DEF CBOX ({ rect | #rectAddr& }, stringVar$)
DEF CHANGEDRESOURCE (rHndl&)
DEF CHECKONEITEM (menuID%, itemID%)
DEF CLEARHANDLE (handle&)
DEF CREATERESFILE (fileName$)
DEF CYCLE (min%, max%, var%)
DEF DEBUGNUMBER (numericExpression)
DEF DEBUGSTRING (stringExpression)
DEF DISPOSEH (handle&)
DEF DRAWIMAGEFILE (fName$, vRef%) /* Not Supported in FBtoC */
DEF DYNAMICINSERTITEMS (gMyDynamicArray,Where&,HowMany&,FillPtr&)
DEF DYNAMICREMOVEITEMS (gMyDynamicArray,First&,HowMany&,SavePtr&)
DEF EMBEDBUTTON (childButtonID&, parentButtonID&)
DEF FLASH
DEF FN functionName [(var1 [, var2 ...])] = expr
DEF FN functionName [ (var1 [, var2 ...]) ]
DEF FN functionName [(var1 [, var2 ...])] USING FNaddress&
DEF GETBUTTONDATA (bRefNum&, part%, tagType&, maxSize&, dataPtr&, actualSize&)
DEF GETBUTTONTEXTSELECTION (bRefNum&, selStart, selEnd)
DEF GETIMAGEFILERECT (fName$,vRef%,r AS RECT) /* Not Supported in FBtoC */
DEF LBOX ({ rect | #rectAddr& }, stringVar$)
DEF LCASE (string$)
DEF LCOPY
DEF LEN [=] stringVarLength /* Not Supported in FBtoC */
DEF LONGBLOCKFILL (startPtr&, numBytes&, byteValExpr)
DEF LPRINT
DEF NEWWINDOWPOSITIONMETHOD (pMethod)
DEF OPEN [=] typeCreatorString$
DEF ORSICN (x%, y%, sicnID%)
DEF PAGE
DEF PLOTSICN (x%, y%, sicnID%)
DEF PRINTEDITFIELD (efNum& | %)
DEF RBOX ({ rect | #rectAddr& }, stringVar$)
DEF REMOVESTR (str#handle&, item%)
DEF SETBUTTONDATA (bRefNum&, part%, tagType&, size&, dataPtr&)
DEF SETBUTTONFOCUS (bRefNum&)
DEF SETBUTTONFONTSTYLE (bRefNum&, controlFontRecord)
DEF SETBUTTONTEXTSELECTION (bRefNum&, selStart, selEnd)
DEF SETBUTTONTEXTSTRING (bRefNum&, pString$)
DEF SETDOUBLEBYTE /* Not Supported in FBtoC */
DEF SETSINGLEBYTE /* Not Supported in FBtoC */
DEF SETWINDOWBACKGROUND (_backgroundConstant,applyNowBool)
DEF SETWINDOWBACKGROUND (rgbColor,applyNowBool)
DEF SHADOWBOX ({ rect | #rectAddr& })
DEF SHOWPOP ({ rect | #rectAddr& })
DEFSTR { LONG | WORD | BYTE }
DEF TAB [=] fieldWidth
DEF TITLERECT (title$, titlePosition%, { rect | #rectAddr& })
DEF TOGGLE ({ var% | #intPtr& })
DEF TRANSITIONRECT (left%, top%, right%, bottom%)
DEF TRUNCATE ({ var$ | #stringPtr& })
DEF USING [=] intlMoneyFormat&
DEF WINDOWCATEGORY (wNum&, category&)
DEF WINDOWREPOSITION (wRefNum&, parentRefNum&, positionMethod)
DEFSNG letter1 [- thruLtr1 ] [, letter2 [- thruLtr2 ]...]
DEFDBL letter1 [- thruLtr1 ] [, letter2 [- thruLtr2 ]...]
DEFSTR letter1 [- thruLtr1 ] [, letter2 [- thruLtr2 ]...]
DEFINT letter1 [- thruLtr1 ] [, letter2 [- thruLtr2 ]...]
DEFLONG letter1 [- thruLtr1 ] [, letter2 [- thruLtr2 ]...]
DELAY count
evnt% | & = DIALOG (0)
id% | & = DIALOG (evnt)
DIALOG = expr%
DIM declaration1 [, declaration2 ...]
DIM DYNAMIC - see the DYNAMIC statement
DIM END RECORD - see the DIM RECORD statement /* Not Supported in FBtoC */
DIM RECORD recordName /* Not Supported in FBtoC */
DIM SYSTEM staticExpr& [, preferredSize& [, version& [, release& [, aboutStringWith4CharPrefix$ ] ] ] ]
DO [statementBlock] UNTIL expr
[ DIM ] DYNAMIC arrayName(maxSub1 [, maxSub2 ...]) [AS dataType]

E[edit]

EDIT = fieldMargin
fieldContents$ | container$$ = EDIT$ (fieldID)
fieldContents$ | container$$ = EDIT$ (fieldID, lineNumber)
fieldContents$ | container$$ = EDIT$ (fieldID, -1)
fieldContents$ | container$$ = EDIT$ (fieldID, selStart, selEnd)

EDIT$ (efID) = string$ | &ZTXThandle& | %TEXTresID% | #container$$ font, size, style, mode, red, green, blue

EDIT$ (efID,lineNumber) = string$ | &ZTXThandle& | %TEXTresID% | #container$$ font, size, style, mode, red, green, blue

EDIT$ (efID,-1) = string$ | &ZTXThandle& | %TEXTresID% | #container$$ font, size, style, mode, red, green, blue

EDIT$ (efID,selStart,selEnd) = string$ | &ZTXThandle& | %TEXTresID% | #container$$ font, size, style, mode, red, green, blue

EDIT FIELD CLOSE [#] fieldID% | &

(Standard BASIC):
EDIT FIELD [#] idExpr [, [ text ] [, [ rect ] [, [ type ] [, efClass ] ] ] ]
EDIT FIELD 0

(Appearance Manager):
EDIT FIELD [#] idExpr [, [ text ] [, [ rect ] [, [ type ], [ efClass ],[ keyFilterProc ] ] ] ]
EDIT FIELD - idExpr
EDIT FIELD 0

EDIT MENU menuParm

Syntax (Standard BASIC):
EDIT TEXT [ #optionalFieldNum%,] [ font ] [, [ size ] [, [ style ] [, [ mode ] [, red, green, blue ] ] ] ]

Syntax (Appearance Runtime):
EDIT TEXT [ #optionalFieldNum%,] [ font ] [, [ size ] [, [ style ] [, [ mode ] [, foreRGB ] [, backRGB ] ] ] ]

EJECT driveExpr /* Not Supported in FBtoC */
END ENUM - See the BEGIN ENUM statement
END FN - See the LOCAL FN and LONG FN statement
END GLOBALS - See the BEGIN GLOBALS statement
END IF - See the LONG IF statement
END RECORD - See the BEGIN RECORD statement
END SELECT - See the SELECT statement
ENDASSEM - See the BEGINASSEM statement /* Not Supported in FBtoC */

Syntax 1:

"statementLabel"
ENTERPROC [ (intVar1 [, intVar2 ...]) ]

[statementBlock]
EXITPROC [= intVar3 ]

Syntax 2:

"statementLabel"
ENTERPROC FN fnName[ (intVar1 [, intVar2 ...]) ] [= type ]

[statementBlock]
EXITPROC [= returnValue ]

error# = FN ERF# (z#)
complementaryError# = FN ERFC# (z#)
errorInfo% = ERROR
ERROR = _noErr
eventRecPtr& = EVENT
eventInfo% = EVENT%
EventInfo& = EVENT&
EVENT% = shortIntValue%
EVENT& = longIntValue&
EXIT CASE
EXIT DO
EXIT FN
EXIT FOR
EXIT NEXT
EXIT UNTIL
EXIT WEND
EXIT WHILE
EXIT "label"
EXITPROC - See the ENTERPROC statement
result# = EXP (expr)

F[edit]

result& = FN FBCOMPARECONTAINERS (a$$, b$$)
result& = FN FBCOMPAREHANDLES (a&, b&)
ignored = FN FBGETCONTROLRECT (cHndl &, rect)
ignored = FN FBGETSCREENRECT (rect)
name$ = FN FBGETSYSTEMNAME$ (nameType)
FN FBMAKEFSSPEC (inVol%, inDir&, name$, FSSpec ) /* Not Supported in FBtoC */
result& = FN FBTESTFORLIBRARY ("Library Name") /* Not Supported in FBtoC */
fileType$ = FILES$
folderName$ = FILES$ (_fFolder,[ prompt$ ],, refNumVar%)
folderName$ = FILES$ (_FSSpecFolder,[ prompt$ ],, FSSpec)
fileName$ = FILES$ (_fOpen,[ typeListString$ ], [ promptString$ ], refNumVar%)
fileName$ = FILES$ (_fOpenPreview,[ typeListString$ ], [ promptString$ ], refNumVar%)
fileName$ = FILES$ (_FSSpecOpen,[ typeListString$ ], [promptString$], fileSpecRecord)
fileName$ = FILES$ (_FSSpecOpenPreview,[ typeListString$ ], [ promptString$ ], fileSpecRecord)
fileName$ = FILES$ (_fSave,[ prompt$ ],[ defaultName$ ], refNumVar%)
fileName$ = FILES$ (_FSSpecSave,[ prompt$ ],[ defaultName$ ], fileSpecRecord)
FILL h, v
action = FINDERINFO (countVar%, nameVar$, typeVar&, dirRefNumVar%)
action = FINDERINFO (countVar%, @FSSpec[(array)],@OSType&[(array)], dirRefNumVar %)
wholeNum# = FIX (expr#)
FLUSHEVENTS
FLUSHWINDOWBUFFER [ { wRef | { _FBAutoFlushOff | _FBAutoFlushOn } ]
result = FN ToolboxFunctionName [ modifiers ] [ ([ { #addrExpr1& | arg1 }[,{ #addrExpr2& | arg2 }...] ]) ]
[ result =] FN functionName [(param1 [, param2 ...])]
folderRefNum% = FOLDER (path$, refNum%)
parentFolderVRef% = FOLDER (":",refNum%)
FOR indexVar = firstValue TO lastValue [ STEP stepValue ]

[ statementBlock ]
NEXT [ indexVar ]

fractionValue# = FRAC (expr)

G[edit]

GET FIELD ZTXThandle&, efID
GET PREFERENCES prefFileName$, prefRecord
GET WINDOW [#] wndID, windowPtrVar&
GETPROCESSINFO index%, processName$ [, PSN ]
GLOBALS "filename1" [, "filename2" ...]
GOSUB { lineNumber | "statementLabel" }
GOTO { lineNumber | "statementLabel" }

H[edit]

HANDLEEVENTS
HANDSHAKE portID, handshakeType
hexString$ = HEX$ (expr)

I[edit]

IF expr THEN { dest1 | statement1 [: statement2 ...]} [ ELSE { dest2 | statement3 [: statement4 ...]}]
INC (intVar)

intVar ++
numericVariable += IntegerValToAdd

INC {LONG|WORD|BYTE} (addr&)
INCLUDE { "<path>" | alisResID }
stringVar$ = INDEX$ (element [, indexID ])
INDEX$ (element [, indexID ]) = stringExpr$
INDEX$ D (element [, indexID ])
INDEX$ I (element [, indexID ]) = stringExpr$
foundElement = INDEXF (string$ [, startElement [, indexID ] ])
stringVar$ = INKEY$
stringVar$ = INKEY$ (deviceID)
INPUT [@(col, row)| % (h, v)] [ "prompt" ;] var1 [, var2 ...]
INPUT# deviceID, var1 [, var2 ...]
foundPosition = INSTR (startPos, targetString$ | targetContainer$$, searchString$ | searchContainer$$)
nearestInteger& = INT (expr#)
ignored = FN INVALRECT (rect)

K[edit]

KILL path$ [, refNum% [, dirID& ]]
KILL APPLEEVENT eventType&, eventClass&
KILL DYNAMIC arrayName
KILL FIELD handle&
KILL PICTURE pictureHandle&
KILL PREFERENCES prefFileName$
KILL RESOURCES "resType", resID%, [ "resType", resID% ...]

L[edit]

subString$ = LEFT$ (string$, numChars)
subContainer$$ = LEFT$$ (container$$, numChars)
stringLength = LEN (string$ | container$$)
[ LET ] var = expr
[ LET ] var;length = address&
LIBRARY "LibraryName"
LIBRARY
lineAddress& = LINE "label"
LINE INPUT [@(col, row)| % (h, v)] [ "prompt" ;] stringVar$
LINE INPUT# deviceID, stringVar$
result = LOC (deviceID)
[ CLEAR ] LOCAL [ MODE ]
[ CLEAR ] LOCAL FN functionName [(arg1 [, arg2 ...])]

[statementBlock]
END FN [= expr ]

LOCATE h,v
numRecords = LOF (deviceID [, recordLength ])
naturalLog# = LOG (expr)
commonLog# = LOG10 (expr)
base2Log# = LOG2 (expr)
LONG COLOR bluePart, greenPart, redPart [, foregroundFlag ]
LONG FN functionName [(arg1 [, arg2 ...])]

[statementBlock]
END FN [= expr ]

LONG IF expr

[statementBlock1]
[ XELSE
[statementBlock2] ]
END IF

LPRINT [@(col, row)|%(h, v)] [ itemList ]

M[edit]

MACHLG { constant | variable }[,{ constant | variable }...] /* Not Supported in FBtoC */
MAXWINDOW h, v
trueOrFalse = MAYBE
info& = MEM (expr)
selectedMenu = MENU (_menuID)
selectedItem = MENU (_itemID)
MENU menuID, itemID, state [, string$ ]
MENU
MENU resID%,{_resMenu| _resSubMenu }, state [, resType$ ]
MENU PREFERENCES menuID, itemID
subString$ = MID$ (string$, startPos [, numChars ])
subContainer$$ = MID$$ (container$$, startPos [, numChars ])
MID$ (stringVar$, startPos, numChars) = replaceString$
MID$$ (container$$, startPos, numChars) = replaceString$ / contnr$$
MINWINDOW h, v
string$ = MKI$ (intExpr)
remainder = expr MOD modulus
buttonStatus = MOUSE (_down)
clickType = MOUSE (0)
locationInfo = MOUSE (locationType)
horzPosition = MOUSE (_horz)
vertPosition = MOUSE (_vert)

N[edit]

result& = exprA { NAND | ^&} exprB
NEXT - See FOR statement
result& = exprA { NOR | ^|} exprB
value = NOT expr

O[edit]

octalString$ = OCT$ (expr)
byteOffset = OFFSETOF (fieldName IN { recordType | trueRecVar })
byteOffset = OFFSETOF (const [ IN pseudoRecVar ])
ON APPLEEVENT (eventtype&, eventClass&) { FN userFunction| GOSUB { lineNumber | "stmtLabel" }}
ON BREAK { FN userFunction| GOSUB { lineNumber | "stmtLabel" }}
ON DIALOG { FN userFunction| GOSUB { lineNumber | "stmtLabel" }}
ON EDIT { FN userFunction| GOSUB { lineNumber | "stmtLabel" }}
ON ERROR { FN userFunction| GOSUB { lineNumber | "stmtLabel" }}
ON ERROR END
ON ERROR RETURN
ON EVENT { FN userFunction| GOSUB { lineNumber | "stmtLabel" }}
ON FINDERINFO { FN userFunction| GOSUB { lineNumber | "stmtLabel" }}
ON expr GOSUB { "label1" | lineNum1 }[,{ "label2" | lineNum2 }...]
ON expr GOTO { "label1" | lineNum1 }[,{ "label2" | lineNum2 }...]
ON LPRINT { FN userFunction| GOSUB { lineNumber | "stmtLabel" }}
ON MENU { FN userFunction| GOSUB { lineNumber | "stmtLabel" }}
ON MOUSE { FN userFunction| GOSUB { lineNumber | "stmtLabel" }}
ON OVERFLOWS { FN userFunction| GOSUB { lineNumber | "stmtLabel" }}
ON STOP { FN userFunction| GOSUB { lineNumber | "stmtLabel" }}
ON TIMER (interval) { FN userFunction| GOSUB { lineNumber | "stmtLabel" }}
TIMER END
TIMER OFF
OPEN "method[fork]", fileID, path$|@FSSpec [, [ recLen ] [, refNum% [, dirID& ] ] ]
OPEN "C", portID, baud [, [ parity ] [, [ stopbit ] [, [ wordLength ] [, buffer ] ] ] ]
OPEN "UNIX", fileID, UNIXcommand$
result& = exprA { OR exprB
OUTPUT [ FILE ] "filePath"
OVERRIDE Local Fn fnName
OVERRIDE Runtime fnName
OVERRIDE EnterProc fnName
OVERRIDE _constantName = newValue

P[edit]

lineCount = PAGE
PAGE
PAGE LPRINT
PARENTID = directoryID& /* Not Supported in FBtoC */
byteValue = PEEK [ BYTE ] (address&)
shortIntValue% = PEEK WORD (address&)
longValue& = PEEK LONG (address&)
PEN [ penWidth ] [, [ penHeight ] [, [ visible ] [, [ mode ] [, pattern ] ] ] ]
pictureHandle& = PICTURE
PICTURE [(h1, v1)] [-(h2, v2)] [, pictureHandle& ]
PICTURE FIELD [#] pfID [, [ pict ] [, [ rect ] [, [ type ] [, just ] ] ] ]
PICTURE ON [(h1, v1)] [-(h2, v2)]
PICTURE OFF [, pictHandleVar &]
PLOT h, v
PLOT TO h, v
PLOT h1, v1 TO h2, v2 [ TO h3, v3 ...]
POKE [ BYTE ] address&, byteExpr
POKE WORD address&, shortIntExpr
POKE LONG address&, longIntExpr
POP (var) /* Not Supported in FBtoC */
POP { BYTE | WORD | LONG }(address&) /* Not Supported in FBtoC */
numCharacters = POS (deviceType)
userCancelled = PRCANCEL
pRecH& = PRHANDLE
PRINT [@(col, row)|%(h, v)] [ printItem [{,|;}[ printItem ]...] ]
PRINT [@(col, row)|%(h, v)] [POINT [{,|;}[POINT]...] ]
PRINT# deviceID,[ printItem [{,|;}[ printItem ]...] ]
procAddress& = PROC "label"
string$ = PSTR$ (address&)
PSTR$ (addressVar&) = string$
PUSH (var) /* Not Supported in FBtoC */
PUSH { BYTE | WORD | LONG }(address&) /* Not Supported in FBtoC */
PUT PREFERENCES prefFilePath$, prefRecord

R[edit]

RANDOM [ -IZE ] [ expr ]
RATIO h, v
READ { var | PSTR$ (addressVar&)}[,{ var | PSTR$ (addressVar&)}...]
READ # deviceID,{ recVar | numVar | strVar$ ; len } [,{ recVar | numVar | strVar$ ; len }...]
READ DYNAMIC deviceID,arrayName
READ FIELD [#] deviceID,handleVar
READ FILE [#] deviceID,address&,numBytes&
currentRecord = REC (fileID)
RECORD [#] fileID, recordNum [, positionInRecord ]
currentA5& = REGISTER(A5) /* Not Supported in FBtoC */
REGISTER ON /* Not Supported in FBtoC */
REGISTER OFF /* Not Supported in FBtoC */
[statement] REM [remarks]
[statement] ' [remarks]
[statement] // [remarks]
[statement] /* [blockRemarks]*/ [statement]
RENAME oldPath$ { TO |,} newFileNameOnly$ [, refNum% [, dirID& ]]
RESET
RESOURCES "[ pathname ]" [," ttttcccc "]
RESTORE [ expr ]
RETURN [ "label" ]
subString$ = RIGHT$ (string$,numChars)
subContainer$$ = RIGHT$$ (container$$,numChars)
randomInteger% = RND (expr%)

To re-route text and graphics:
ROUTE [#]_toPrinter
ROUTE [#]_toScreen
ROUTE [#]_toBuffer [+ 0... 4 ]

To re-route text:
ROUTE [#] serialPort
ROUTE [#] fileID
RUN path$ [, refNum% [, dirID& ]]
RUNTIME routineName [(arg1 [, arg2 ...]) ]
END RUNTIME

S[edit]

SCROLL (h1, v1)-(h2, v2), hPixels%, vPixels%
SCROLL BUTTON [#] idExpr [, [ current ] [, [ min ] [, [ max ] [, [ page ] [, [ rect ] [, type ] ] ] ] ] ]
SEGMENT [ minSegmentSize ] /* Ignored in PPC */
SEGMENT RETURN /* Ignored in PPC */

SELECT [ CASE ] targetExpr

CASE testExpr [, testExpr ...] [, max32TestExpr ...]
[statementBlock]
[ CASE testExpr [, testExpr ...] [,max32TestExpr ...]
[statementBlock]...]
[ CASE ELSE
[statementBlock] ]
END SELECT

SELECT [ CASE ]

CASE booleanExpr [, booleanExpr ...] [, max32T booleanExpr ...]
[statementBlock]
[ CASE booleanExpr [, booleanExpr ...] [, max32T booleanExpr ...]
[statementBlock]...]
[ CASE ELSE
[statementBlock]]
END SELECT

SENDAPPLEEVENT eventtype&, eventClass&, dataAddress& dataSize&, processName$
SETSELECT startSelect%, endSelect%
SETZOOM [#] windowID [,(h1, v1)-(h2, v2)]
SETZOOM [#] windowID, @ rect
signOfExpr = SGN (expr)
SHUTDOWN [ msg$ ]
theSine# = SIN (expr)
result# = SINH (expr)
dataSize = SIZEOF ({ var | typeName | ptrType ^| hdlType ^^})
SOUND END
SOUND pitch, duration [, [ volume ] [, async ]]
SOUND soundIDstring$
SOUND %resIDNumber
SOUND &soundHandle&
soundIsPlaying = SOUND%
stringOfSpaces$ = SPACE$ (numChars)
SPC (numChars)
squareRoot# = SQR (expr)
STOP [ string$ ]
stringFromList$ = STR# (resourceID%, index%)
numberString$ = STR$ (numericExpr)
stringFromHandle$ = STR& (handle&, index%)
stringOfChars$ = STRING$ (numChars,{ char$ | asciiValue% })
container$$ = STRING$$ (numChars,{ char$ | asciiValue% })
STRINGLIST ON /* Not Supported in FBtoC any form */
STRINGLIST OFF
STRINGLIST
STRINGLIST = resID [, ResourceName$ ]
STRINGLIST OPT
STRINGLIST NOPT
STRINGLIST END
SWAP variable1, variable2
systemErrorCode% = SYSERROR
SYSERROR = OSErrorCode%
systemInformation = SYSTEM (whichInfo)
SYSTEM

T[edit]

theTangent# = TAN (expr)
result# = TANH (expr)
TBALIAS oldName, NewName /* Not Supported in FBtoC */
editFieldHandle& = TEHANDLE (fieldID) /* Not Supported in FBtoC */
fieldInfo = TEHANDLE (- fieldID)
char$ = TEKEY$
TEKEY$ = string$
TEXT [ font% ] [, [ size% ] [, [ face% ] [, copyMode% ] ] ]
THREADBEGIN FN name [, parameter& [, stackMin&] ]
abortBoolean = THREADSTATUS [ (ticks&) ]
currentTime$ = TIME$
secondsSinceMidnight& = TIMER
TIMER = interval
TIMER (0) OFF
TIMER (0) END
TOOLBOX [ FN ] functionName [(arg1 [, arg2 ...]) ] [= returnParam ] [` 0x0000, 0x0000 ...]
TRON [ ALL ]
TRON BREAK
TROFF
TRON X
dataType = TYPEOF ({ variable | typeName })

U[edit]

theTangent# = TAN (expr)
upperCaseString$ = UCASE$ (string$)
upperCaseContainer$$ = UCASE$$ (container$$)
returnVar = UNIVERSALFN (procPtr&, flags [, parm1 [, parm2 ...] ]) /* Not Supported in FBtoC */
UNIVERSALPROC (procPtr&, flags [, parm1 [, parm2 ...] ]) /* Not Supported in FBtoC */
UNLOADSEGMENT "statementLabel " /* Not Supported in FBtoC */
digitString$ = UNS$ (expr)
UNTIL
string$ = USING format$ ; expr
returnValue& = USR fnIndicator (expr)
absValue& = USR ABS (expr)
dataHandle& = USR APPLESCRIPTGETRESULT
errorFlag = USR APPLESCRIPTLOADANDRUN (fSpec, resID%)
errorFlag = USR APPLESCRIPTRUN (errorMessage$)
errFlag = USR APPLESCRIPTSTORE (fSpec, resID%, scriptName$)
err = USR CONVERTIMAGEFILE (srcName$,srcRef%, destName$,destRef%, newTypeIn&, newCreator &)
err = USR COPYFILE (SrcName$, SrcVol%, SrcDir&, DestName$, DstVol%, DstDir&)
elementSize& = USR DYNAMICITEMSIZE (whichIndex)
evenNumber& = USR EVEN (expr)
boolean = USR FILEEXISTS (fileName$, vRefNum%, dirID&)
fontHeight = USR FONTHEIGHT
boolean = USR FSFILEEXISTS (fsSpec)
error = USR FSSENDFILETOTRASH (FSSpec)
resultCode = USR FSGETFOLDERNAME (fsSpec,folderName$)
resultCode = USR FSGETFULLPATHNAME (fsSpec,pathName$)
boolean = USR GETDOUBLEBYTE /* Not Supported in FBtoC */
resultCode = Usr FSGETFOLDERNAME (fsSpec, folderName$)
resultCode = USR GETFULLPATHNAME (vRef%,dirID&,pathName$)
boolean = USR GETSINGLEBYTE /* Not Supported in FBtoC */
pictHandle& = USR GETPICT ({ rect | #rectAddr& })
buttonID% = USR HANDLE2BTN (ctrlRecHandle&)
pictHandle& = USR IMAGEFILETOPICT (fileName$, vRef%)
err = USR MOVEFILE (SrcName$,SrcVol%,SrcDir&,DstVol%,DstDir&)
resRef = USR OPENRFPERM (fileName$,vRef%,permission) /* Not Supported in FBtoC */
rHndl& = USR REPLACERESOURCE (rHndl&, rTp&, rID%,rName$, rRef%)
wholeNumber = USR ROUND (numericExpression)
wholeNumber = USR ROUNDUP (numericExpression)
wholeNumber = USR ROUNDDOWN (numericExpression)
err% = USR SAVEIMAGEFILEASPICT (srcName$, srcVol%, destName$,destVol%)
resultCode = USR SCANFOLDER (FileScanRecord)
error = USR SENDFILETOTRASH (fileName$, vRefNum %) /* Not Supported in FBtoC */
offset& = USR STROFFSET (element%, resID% | handle&)
WindowID% = USR WPTR2WNUM (WindowPtr&)

V[edit]

numericValue = VAL (string$)
integerValue& = VAL& (string$)
ignored = FN VALIDRECT (rect)
address& = VARPTR ({ var | FN userFunction})
address& = @ var

W[edit]

WIDTH [ LPRINT ] [=]{_noTextWrap|_textWrap| numChars }
WindowInformation = WINDOW(expr)
WINDOW [#] idExpr [, [ title$ ] [, [ rect ] [, [ type ] [, class ] ] ] ]
WINDOW CLOSE [#] windowID
WINDOW FILL [[#] expr ]
WINDOW OUTPUT [#] idExpr
WINDOW PICTURE [#] windowID,pictHandle&
ptr& = WNDBLK /* Not Supported in FBtoC */
WRITE [#] deviceID,{ var | strngVar$ ; len } [,{ var | strngVar$ ; len }...]
WRITE DYNAMIC deviceID, arrayName
WRITE FIELD [#] deviceID, handle&
WRITE FILE [#] deviceID, address&, numBytes&

X[edit]

XELSE - See the LONG IF statement
result& = exprA {XOR | ^^} exprB
XREF arrayName (maxSub1 [, maxSub2 ...]) [ AS dataType ]
XREF@ arrayName (maxSub1 [, maxSub2 ...]) [ AS dataType]


Template (to be removed later)[edit]

Click here for Template

Go here: <http://en.wikibooks.org/wiki/Futurebasic/language/reference> to admire the long list of keywords to work on.

Use template page (the link is just above).

To edit an entry:

1 - Click on the link titled Template (above the list of keywords).

2 - A new page is displayed in your browser showing how the layout of an entry looks like. Click on the top most link on the right of the screen (probably titled [edit] in English).

3 - The browser opens a new page displaying a form. The main field contains the code used to create the template. It looks like the following:

= <span style="color:red">Layout Template (remove this line)</span> =

== Keyword Goes Here ==

=== Statement Function Operator or Other? (update the checkmarks below) ===
✔ χ Appearance ✔ χ Standard ✔ χ Console

=== Syntax ===
<pre>
code syntax goes here and is pre-formatted (plain text)
</pre>

=== Revised ===
Date & release (remove the Revised section if no date)

=== Description ===
Description goes here.

=== Example ===
<pre>
Sample code goes here (remove the Example section if no sample code)
</pre>

=== Notes ===
Special notes. (leave this section if no notes)

=== See Also ===
<code>cross-reference</code>

[[Futurebasic/language/reference|Language Reference]]

4 - Copy the whole text (you can possibly paste it in a text editor window to have it handy at a later time).

5. - If you haven't already done so, put beer in fridge

6 - Now go find a keyword in the list whose entry is empty, and paste the template code and click on the Save button.

If you're not comfortable with HTML, leave to someone else the updating of the entry and repeat the process for another empty keyword entry (i.e. GOTO #6).

If you want to proceed further:

7 - Open the FB Help page in a new browser window or better a text editor. If you're using a browser you will have to display the HTML source code.

Now, depending on your skill with HTML coupled with wiki idiosyncrasy you might do the following:

8a - Edit again the keyword entry updating each section with the corresponding HTML code of the FB Help page.

9a - Save your change and leave to someone else the pleasure to clean up the mess.

or

8b - Clean up the HTML code in your text editor. Sometimes, there are a bunch of tags to remove and even to use more efficiently, I guess. Leave the links related to the missing image resources, it might help later to find out which entries require illustrations. Maybe Christopher can tell us how we can manage the image files.

FB snippets of code of the Ref manual need serious cleaning since they are inserted inside <pre></pre> tags therefore they cannot embed any other HTML code. Other things are worth to know (perhaps for another post), but I think the rule of thumb is to end-up with the less HTML code as possible.

9b - Update each section of the keyword entry with the appropriate clean HTML code.

10 - Repeat ad nauseum (i.e. GOTO #6) with a variant, though: try to find also keyword entries whose template has not been updated.

11 - Celebrate in true Staz style (with beer) when you're done (optional).