\ SwiftForth-2 Glossary
0 [IF] =======================================================
Get TEXT
GLOSSARY
!+ !NOW !REL !TIME&DATE #STRANDS #USER 'MAIN
'MONITOR (.) (DATE) (P) (SFDATE) (TIME)
(WID-CREATE) (WINLONGDATE) (WINSHORTDATE) ++
+PROGRESS +SMUDGE +TO +USER ," ,REL ,U" ,Z"
,Z\" ,\" -? -PROGRESS -SMUDGE .DATE .DLLS
.IMPORTS .PROGRESS .SPART .TIME /FSTACK 1/N
3DROP 3DUP :PRUNE CODE >LINK >NAME
>PRINT >THROW >f >fs ?FSTACK ?PRUNE ?PRUNED
@+ @DATE @NOW @REL @TIME ACTIVATE APPEND AS
BINARY BODY> CALLS CHECKITEM CIMPORT: CODE>
CONFIG: COS COT COUNTER CSC C\" C] D/M/Y
DASM DATE DDE-END DDE-INIT DDE-REQ DDE-SEND
DF+! DFCONSTANT DFI@ DFLITERAL DFVARIABLE DPL
DefaultClass DefineClass EAGER/LAZY EDIT EMPTY
END-CODE ENG ENUM ENUM4 EXPIRED EXPORT: F+!
F, F.R F2* F2/ F2DUP F>S F?DUP FI! FI@
FILITERAL FIX FL, FLITERAL FS, FWITHIN GET
GILD GRAYITEM HALT HILO HIS HIWORD HOURS HWND
ICODE IDUMP IMPORT: INCLUDE ITEM KILL
KNOWN-VKEYS L LABEL LIBRARY LMATRIX LMD LOCALS|
LOCATE LOHI LOWORD LPARAM M/D/Y MAKE-FLOOR
MAKE-ROUND MEM MENUITEM MONITOR MS MSG N.
NAME> NEXT-WORD NH NOW NUMBER NUMBER? OCTAL
OFF ON PAUSE PERSONALITY PLACE POPPATH PROGRAM
PROGRESS-NAME PROGRESS-TEXT PUSHPATH RELEASE
REMEMBER RESUME RUNS S>F SBLEFT SBRIGHT SCI
SEC SEE SEPARATOR SERVER SF+! SFCONSTANT SFI@
SFLITERAL SFVARIABLE SILENT SIN SMATRIX SMD
STARTER STOP STRING, SUSPEND SWITCH] S\" Sleep
TAN TASK TERMINATE TIME TIMER TOPIC U"
UBETWEEN UNCALLED U\" VERBOSE WARNING WATCH WH
WHERE WINERROR WPARAM Z" ZAPPEND ZERO ZPLACE
Z\" [+ASSEMBLER] [+FORTH] [+SWITCH [C [MENU
[POPUP [PREVIOUS] [SWITCH \\ _PARAM_4, _PARAM_5,
_PARAM_6, _PARAM_7 f> fs> uCOUNTER uTIMER {
~!+
/GLOSSARY
!+ ( addr x -- addr+4 )
Write the value _x_ to _addr_, and increment the address by
one cell.
!NOW ( ud u -- )
Take the same parameters as those returned by `@NOW` and
set the system time and date.
!REL ( addr_1 addr_2 -- )
Store the absolute address _addr_1_ in _addr_2_, having
first converted it to a relative address.
!TIME&DATE ( u1 u2 u3 u4 u5 u6 -- )
Convert the stack arguments _u1_ seconds (0..59), _u2_ minutes
(0..59), _u3_ hours (0..23), _u4_ day (1..31), _u5_ month (1..12),
_u6_ year (1900..2079) to internal form and store them as
the system date and time.
#STRANDS ( -- addr )
Variable containing the number of strands in a wordlist.
Its default value is 31.
#USER ( -- n )
Return the number of bytes currently allocated in a user
area. This is an appropriate offset for the next user
variable when this word is used to start a sequence of
`+USER` definitions intended to add to previously defined
user variables.
'MAIN ( -- addr )
Return the address of an execution vector containing the
main program word to be launched at startup. This will
occur after the DLLs have been loaded, but before the
`STARTER` word set in a turnkey is executed. The default
for SF.EXE is `GUI-STARTUP` (which launches the command
window).
'MONITOR ( -- addr )
Returns the address of an execution variable that may be
set to contain an xt for a word to be executed by the
`INCLUDE` monitor.
(.) ( n -- addr u )
Convert _n_ to characters, without punctuation, as for `.`
(dot), returning the address and length of the resulting
string.
(DATE) ( u1 -- addr u2 )
`(DATE)` is an execution vector that may be set to any
suitable formatting behavior. The default is `(SFDATE)`,
which formats the MJD _u1_ as a string with the format
_mm_`/`_dd_`/`_yyyy_, returning the address and length of the
string.
(P) ( addr_1 addr_2 -- addr_3 )
Given the address _addr_1_ of a personality table and a
personality execution vector _addr_2_, return the address
of that vector in the specified table.
(SFDATE) ( u1 -- addr u2 )
Format the MJD _u1_ as a string with the format
_mm_`/`_dd_`/`_yyyy_, returning the address and length of
the string. This is the default behavior of `(DATE)`.
(TIME) ( ud -- addr u )
Format the time _ud_ as a string with the format
_hh_`:`_mm_`:`_ss_, returning the address and length of
the string.
(WID-CREATE) ( addr u wid -- )
Create a definition for the counted string at _addr_, in
the wordlist _wid_.
(WINLONGDATE) ( u1 -- addr u2 )
Format the MJD _u1_ as a string using the Windows long date
format. This is a possible alternative behavior for
`(DATE)`.
(WINSHORTDATE) ( u1 -- addr u2 )
Format the MJD _u1_ as a string using the Windows short
date format. This is a possible alternative behavior for
`(DATE)`.
++ ( addr -- )
Increment the value at _addr_.
+PROGRESS ( addr -- )
Launch a progress bar, with the ASCIIZ string whose
address is given displayed in the title bar.
+SMUDGE ( -- )
Set the smudge bit in the flags byte, thus rendering the
name invisible to the dictionary search. This bit is set
for a colon definition while it is being constructed, to
avoid inadvertent recursive references.
+TO ( n "name" -- )
Add _n_ to the contents of _name_, where _name_ must be a local
variable or defined by `VALUE`.
+USER ( n1 n2 -- n3 )
Define a user variable at offset _n1_ in the user area, and
increment the offset by the size _n2_ to give a new offset
_n3_.
," ( "string" -- )
Compile the following string in the dictionary starting
at `HERE`, and allocate space for it.
,REL ( addr -- )
Compile the absolute address addr at `HERE`, having first
converted it to a relative address.
,U" ( "string" -- )
Similar to `,"` but the string may contain a `\` followed by
one or more characters which will be converted into a
control or other special character according to the
transformations listed in Table 15. For example, `,\"
Nice\nCode!\n"`.
-? ( -- )
Suppress redefinition warning for the next definition
only.
-PROGRESS ( -- )
Close a current progress bar, if there is one. Does
nothing otherwise.
-SMUDGE ( -- )
Clear the smudge bit.
.DATE ( u -- )
Display the MJD _u_ in the format applied by `(DATE)`.
.DLLS ( -- )
Display a list of all available DLLs (previously defined
with `LIBRARY`).
.IMPORTS ( -- )
Display a list of all currently available WINPROCs
(previously defined with `IMPORT:`), showing for each its
resolved address, the DLL in which it is defined, and its
name.
.PROGRESS ( n -- )
Display gray bars in the horizontal progress area
reflecting _n_ percent (0..100) completion.
.SPART ( addr n -- )
Display, in part _n_ (0 through 5) of the status bar, the
zero-terminated string located at _addr_.
.TIME ( ud -- )
Display the time _ud_ in the format applied by `(TIME)`
above.
/FSTACK ( -- )( F: i*r -- )
Clear the numeric stack.
1/N ( -- )( F: r_1 -- r_2 )
Replace the top floating-point stack value with its
reciprocal value.
3DROP ( x1 x2 x3 -- )
Drop the top three items from the stack.
3DUP ( x1 x2 x3 -- x1 x2 x3 x1 x2 x3 )
Place a copy of the top three stack items onto the stack.
:PRUNE ( addr1 -- addr2 )
Add an un-named definition to the list of functions to be
executed when `MARKER` or `REMEMBER` is invoked, to restore
the system to a saved state. When the `:PRUNE` definition
is executed, _addr1_ provides the address where the data
has been stored by a `:REMEMBER` in the same overlay layer.
CODE ( xt -- addr )
Return the code address _addr_ corresponding to _xt_.
>f ( -- )
Assemble FPU instructions to transfer one numeric stack
item to the hard-ware stack.
>fs ( n -- )
Assemble FPU instructions to transfer _n_ numeric stack
items to the hardware stack. Stack order is preserved.
>LINK ( addr -- )
Add a link starting at `HERE` to the top of the linked list
whose head is at _addr_ (normally a variable). The head is
set to point to the new link, which, in turn, is set to
point to the previous top link.
>NAME ( xt -- addr )
Return the address of the name field for the definition
_xt_.
>PRINT ( "commands" -- )
Execute whatever commands follow to the end of the line,
routing any output to the current printer.
>THROW ( n addr u -- n )
Associate the string _addr u_ with the `THROW` code _n_ such
that SwiftForth's standard error handler will display
that string if it `CATCH`es its error code. The code is
returned to facilitate naming it as a constant.
?FSTACK ( -- )( F: i*r -- i*r )
Check the numeric stack and abort if there are no numbers
on it.
?PRUNE ( -- flag )
Return true if the definition in which it is being
invoked is being discarded (e.g., a `MARKER` is being
executed).
?PRUNED ( addr -- flag )
Return true if _addr_ is no longer within the active
dictionary (e.g., it has been discarded via `MARKER` or
`REMEMBER`).
@+ ( addr -- addr+4 x )
Fetch the value _x_ from addr, and increment the address by
one cell.
@DATE ( -- u )
Return the current system date as an MJD.
@NOW ( -- ud u )
Return the system time as an unsigned, double number _ud_
representing seconds since midnight, and the system date
as _u_ days since 01/01/1900. Used (for example) by
`TIME&DATE` (see the Forth Programmer's Handbook).
@REL ( addr_1 -- addr_2 )
Fetch a relative address from _addr_1_ to the stack,
converting it to the absolute address _addr_2_.
@TIME ( -- ud )
Return the system time as an unsigned, double number
representing seconds since midnight.
ACTIVATE ( addr -- )
Instantiate the task whose TCB is at _addr_, and start it
executing the words following `ACTIVATE`. Must be used
inside a definition. The words after `ACTIVATE` must be
structured as an infinite loop or must end with
`TERMINATE`, so that the semicolon at the end of the
definition is never executed. Also, the code must call
`PAUSE` or `STOP` so task control can function properly. If
the task was already instantiated, `ACTIVATE` will simply
store into the task's user variable `SAVEIP` a pointer to
the code following `ACTIVATE`. The task will begin
executing the specified code immediately after the next
`PAUSE` or `STOP`.
APPEND ( addr1 u addr2 -- )
Append the string at _addr1_, whose length is _u_, to the
counted string already existing at _addr2_. Does not check
to see if space is allocated for the final string.
AS ( "name" -- )
Provide a different internal Forth name for an imported
function, or a different external name for a function
exported from a SwiftForth DLL (Section 8.2.2).
BINARY ( -- )
Set `BASE` for binary (base 2) number conversions on input
and output.
BODY> ( addr -- xt )
Return the _xt_ corresponding to the parameter field
address _addr_.
CALLS ( addr -- )
Run down a linked list starting at _addr_, executing the
high-level code that follows each entry in the list.
CHECKITEM ( n "text" -- )
Add an enabled menu item whose ID is _n_, which will be
labeled text. Must be used within a menu or submenu
definition. The item will be initially marked with a
checkmark.
CIMPORT: ( n "name" -- )
Define a named call to a C-prototype Windows procedure,
which will take _n_ parameters.
CODE> ( addr -- xt )
Return the _xt_ corresponding to the code address _addr_.
CONFIG: ( "name" -- )
Define a word that will be placed in the list of
configuration parameters to be maintained in the Windows
registry. When executed, _name_ must return the address and
length of its data area, which will be recorded and
initialized by SwiftForth at startup.
COS ( -- )( F: x -- r )
Return the cosine of _x_, where _x_ is in degrees.
COT ( -- )( F: x -- r )
Return the cotangent of _x_, where x is in degrees.
COUNTER ( -- u )
Return the current value of the millisecond timer.
CSC ( -- )( F: x -- r )
Return the cosecant of _x_, where _x_ is in degrees.
C\" ( "string" -- addr )
Compile a counted string, returning its address. The
string may contain a `\` followed by one or more characters
which will be converted into a control or other special
character according to the transformations listed in
Table 15.
C] ( -- )
Terminate a critical section.
D/M/Y ( u1 u2 u3 -- u4 )
Convert day _u1_, month _u2_, and year _u3_ into MJD _u4_.
DASM ( addr -- )
Disassemble code starting at _addr_.
DATE ( -- )
Display the current system date.
DDE-END ( -- )
Terminate the conversation.
DDE-INIT ( -- )
Check for necessary data (server, topic, item) and open
the conversation. If the server doesn't respond or
doesn't recognize the topic, a `1005 THROW` will occur.
DDE-REQ ( -- addr )
Send a request item to the server, and receive a response
as an ASCIIZ string at _addr_ (which is at `PAD`).
DDE-SEND ( addr n -- )
Send the string _addr n_ to the server.
DefaultClass ( addr xt -- n )
Register a class whose name is the zero-terminated
string at _addr_ and whose callback routine is _xt_, with
default parameters as shown in Table 23. Return the
class handle.
DefineClass ( x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 -- n )
Accept parameters on the stack and register the class.
Refer to Table 23 for the parameter list and
descriptions. Return the class handle.
DF+! ( addr -- )( F: r -- )
Same as `F+!`.
DFCONSTANT ( "name" -- )( F: r -- )
Define a floating-point constant with the given name
whose value is _r_, compiled in double (64-bit) format.
When _name_ is executed, _r_ will be returned on the
floating-point stack.
DFI@ ( addr -- )( F: -- r)
On this system, the same as `FI@`. "Double fetch"
DFLITERAL ( -- )( F: r -- )
Compile the number on the floating-point stack as a
64-bit floating-point literal.
DFVARIABLE ( "name" -- )
Define a floating-point variable with the given name,
allocating space to store values in double (64-bit)
format. When _name_ is executed, the address of its data
space will be returned on the data stack.
DPL ( -- addr )
Return the address of a variable containing the
punctuation state of the number most recently converted
by `NUMBER?` or `NUMBER`. If the value is negative, the
number was unpunctuated. If it is non-negative, it
represents the number of digits to the right of the
rightmost punctuation character.
EAGER/LAZY ( -- addr )
Variable that determines whether DLL files will be
instantiated when loaded or when needed. A non-zero value
causes instant instantiation; defaults to -1 (eager).
EDIT ( "name" -- )
Launches or switches to a linked editor, passing it
appropriate commands to open and position a source file.
The name following `EDIT` is optional. If it is present,
`EDIT` will attempt to find it as a defined word and to
open the file in which it is defined, positioned at its
definition. If name cannot be found in the dictionary,
`EDIT` will attempt to treat it as a filename and open the
file. If no text is provided, `EDIT` will select the source
for the item most recently displayed by `LOCATE`, `L`, or a
double-click.
EMPTY ( -- )
Reset the dictionary to a predefined golden state,
discarding all definitions and releasing all allocated
data space beyond that state. The initial golden state of
the dictionary is that following the launch of
SwiftForth; this may be modified using `GILD`.
END-CODE ( -- )
Terminate an assembler sequence started by `CODE` or `LABEL`.
ENG ( n -- )
Configure `N.` to use the `FE.` output format with _n_
significant digits.
ENUM ( n1 "name" -- n2 )
Define name as a constant with value _n1_, then increment
_n1_ to return _n2_. Useful for defining a sequential list of
constants (e.g., `THROW` codes; see Section 4.7).
ENUM4 ( n1 "name"-- n2 )
Define name as a constant with value `n1`, then increment
`n1` by four to return `n2`. Useful for defining a sequential
list of constants that reference cells or cell offsets.
EXPIRED ( u -- flag )
Return true if the current millisecond timer reading has
passed _u_. For example, the following word will execute
the hypothetical word `TEST` for _u_ milliseconds:
Example
: TRY ( u -- ) \ Run TEST repeatedly for u ms.
COUNTER + BEGIN \ Add interval to curr. value.
TEST \ Perform test.
DUP EXPIRED UNTIL ; \ Stop when time expires.
EXPORT: ( n "name" -- )
Export the function _name_ so it will be available to other
programs that load a DLL you create. _n_ indicates the
number of parameters needed by Forth-name.
F+! ( addr -- )( F: r -- )
Add the top floating-point stack value to the 64-bit
contents of the address on the data stack. "Floating plus
store"
F, ( -- )( F: r -- )
Compile the top 64-bit floating-point stack value into
the dictionary. "Floating comma"
F.R ( n1 n2 -- )( F: r -- )
Display _r_ with _n2_ significant digits, right-justified in
a field _n1_ characters wide.
F2* ( -- )( F: r1 -- r2 )
Multiply the top floating-point stack value by 2.
F2/ ( -- )( F: r1 -- r2 )
Divide the top floating-point stack value by 2.
F2DUP ( -- ( F: r1 r2 -- r1 r2 r1 r2 )
Duplicate the top two floating-point stack items.
f> ( -- )
Assemble FPU instructions to transfer one hardware stack
item to the numeric stack.
F>S ( -- n ) ( F: r -- )
Remove the top floating-point stack value, round it to a
32-bit integer, and push it on the data stack.
F?DUP ( -- flag ) ( F: r -- r | )
Test the top of the floating-point stack for non-zero. If
the number is non-zero, it is left and a true value is
placed on the data stack; if the number is zero, it is
popped and a zero (false) is placed on the data stack.
FI! ( addr -- ) ( F: r -- )
Store the top floating-point stack item, rounded to a
64-bit integer, in the address on the data stack.
"Integer store"
FI@ ( addr -- ) ( F: -- r)
Push on the floating-point stack the 64-bit data
specified by the address on the data stack. "Integer
fetch"
FILITERAL ( -- ); ( F: r -- )
Compile the number on the floating-point stack as a
32-bit or 64-bit two's com-plement rounded integer. A
double-length (64-bit) integer is compiled if the number
exceeds 32 bits.
FIX ( n -- )
Configure `N.` to use the `F`. output format with _n_
significant digits.
FL, ( -- ) ( F: r -- )
Same as `F,`.
FLITERAL ( -- ); ( F: r -- )
Same as `DFLITERAL`.
FS, ( -- ) ( F: r -- )
The 32-bit equivalent of `F,`. "Floating short comma"
fs> ( n -- )
Assemble FPU instructions to transfer _n_ hardware stack
items to the numeric stack. Stack order is preserved.
FWITHIN ( -- flag )( F: r l h )
Return a true value on the data stack if the
floating-point value _r_ lies between the floating-point
values _l_ and _h_, otherwise return false.
GET ( addr -- )
Obtain control of the facility variable at addr, having
first executed `PAUSE` (to allow other tasks to run). If
the facility is owned by another task, the task
executing `GET` will wait until the facility is available.
GILD ( -- )
Records the current state of the dictionary as a golden
state such that subsequent uses of `EMPTY` will restore
the dictionary to this state.
GRAYITEM ( n "text" -- )
Add a disabled (gray) menu item whose ID is _n_, which will
be labeled text. Must be used within a menu or sub-menu
definition.
HALT ( addr -- )
Cause the task whose TCB is at _addr_ to cease operation
permanently at the next `STOP` or `PAUSE`, but to remain
instantiated.
HILO ( n1 -- n2 n3 )
Return the upper and lower halves of _n1_ as _n2_
(high-order part) and _n3_ (low-order part).
HIS ( addr1 n -- addr2 )
Given a task address _addr1_ and user variable offset _n_,
returns the address of the referenced user variable in
that task's user area. Usage:
` HIS`
HIWORD ( n1 -- n2 )
Return the high-order two bytes of _n1_ as _n2_ .
HOURS ( ud -- )
Set the current system time to the value represented by
_ud_, which was entered as _hh_`:`_mm_`:`_ss_.
HWND ( -- n )
Return the handle of the window receiving the current
message.
ICODE ( "name" -- )
Start a new assembler definition, _name_. If the definition
is referenced inside a colon definition, its code will be
expanded in-line; if the definition is referenced
interpretively, it will be executed. A word defined by
`ICODE` may not contain any external references (calls or
branches).
IDUMP ( addr u -- )
Displays _u_ bytes, starting at _addr_, as 32-bit integers in
the current base.
IMPORT: ( n "name"-- )
Define a named call to a Windows procedure, which will
take _n_ parameters.
INCLUDE ( "filename[.ext]"-- )
Direct the text interpreter to process _filename_; the
extension is required if it is not ".f". Path information
is optional; it will search only in the current path,
unless you precede filename with path information. Leaves
`BASE` set to decimal. `INCLUDE` differs from the File >
Include menu option and toolbar button in that it does
not offer a browse dialog box and does not change your
current path.
ITEM ( "string" -- )
Set _string_ as a data item to be used as the request or
transaction.
KILL ( addr -- )
Cause the task whose TCB is at _addr_ to cease operation
and release all its memory back to Windows. A task that
has been `KILL`ed may be re-activated.
KNOWN-VKEYS ( -- addr )
Return the address of a table of VKEYS. If an incoming
KEYDOWN event matches an entry in this table, it
will not generate a WM_CHAR message, and SwiftForth will
return the value from the table, masked as appropriate
with the bits shown in Figure 22.
L ( -- )
Following a compiler error, display the line of source at
which the error occurred, along with the source path and
line number, in the SwiftForth command window.
LABEL ( "name" -- )
Start an assembler code fragment, _name_. If the definition
is referenced, either inside a definition or
interpretively, the address of its code will be returned
on the stack.
LIBRARY ( "filename.dll" -- )
Add filename to the list of DLLs currently available to
SwiftForth.
LMATRIX ( nr nc "name" -- )
Construct a similar matrix with 64-bit storage locations.
LMD ( nr nc "name" -- )
Similar to `SMD` but displays a long (64-bit entries)
matrix.
LOCALS| ( xn ... x2 x1 "name_ name2 ... namen |" -- )
Create up to 16 local variables, giving each an initial
value taken from the stack such that _name1_ has the value
_x1_, etc. Must be used inside a colon definition.
LOCATE ( "name" -- )
Display the source from which _name_ was compiled, with the
source path and definition line number, in the SwiftForth
command window. _name_ must be in the current scope.
Equivalent to double-clicking on _name_.
LOHI ( n1 -- n2 n3 )
Return the upper and lower halves of _n1_ as _n2_
(low-order part) and _n3_ (high-order part).
LOWORD ( n1 -- n2 )
Return the low-order two bytes of _n1_ as _n2_ .
LPARAM ( -- n )
Return the fourth parameter for the current message. Its
content is message-dependent.
M/D/Y ( ud -- u )
Accept an unsigned, double-number date which was entered
as _mm_`/`_dd_`/`_yyyy_, and convert it to MJD.
MAKE-FLOOR ( -- )
Configure SwiftForth to use truncation when transferring
numbers from the floating-point stack to the data stack.
This is the ANS Forth convention, and is the default in
SwiftForth.
MAKE-ROUND ( -- )
Configure SwiftForth to use rounding when transferring
numbers from the floating-point stack to the data stack.
This is the FPU convention.
MEM ( addr -- )
Start a window providing a dynamic view of a region of
memory starting at _addr_. If a memory window is already
open, sets its initial address to _addr_.
MENUITEM ( n "text" -- )
Add an enabled menu item whose ID is _n_, which will be
labeled _text_ on the menu. Must be used within a menu or
sub-menu definition.
MONITOR ( -- addr )
Returns the address of the variable whose
least-significant byte controls the actions of the
`INCLUDE` monitor. Bit assignments are shown in Table 11.
MS ( n -- )
`PAUSE` the current task for _n_ milliseconds. The accuracy
of this interval is always about one clock tick.
MSG ( -- n )
Return the message number of the current message.
N. ( -- )( F: r -- )
Display _r_ in a format selected by `FIX`, `SCI`, or `ENG`.
NAME> ( addr -- xt )
Return the _xt_ corresponding to the name at _addr_.
NEXT-WORD ( -- addr u )
Get the next word in the input stream--extending the
search across line breaks as necessary, until the
end-of-file is reached--and return its address and length.
Returns a string length of 0 at the end of the file.
NH ( -- addr )
Return the address of a variable containing the
high-order part of the number most recently converted by
`NUMBER?` or `NUMBER`.
NOW ( ud -- )
Set the current system date to the value represented by
the unsigned, double number which was entered as
_mm_`/`_dd_`/`_yyyy_.
NUMBER ( addr u -- n | d )
Attempt to convert the characters in the string at _addr_,
whose length is _u_, into digits, using the radix in `BASE`,
until the length _u_ expires or a space is encountered.
If valid punctuation ( , . + - / : ) is found, returns _d_;
if there is no punctuation, returns _n_; if conversion
fails due to a character that is neither a digit nor
punctuation, an `ABORT` will occur.
NUMBER? ( addr u -- 0 | n 1 | d 2 )
Attempt to convert the characters in the string at _addr_,
whose length is _u_, into digits, using the radix in `BASE`,
until the length _u_ expires or a space is encoun-tered.
If valid punctuation ( `, . + - / :` ) is found, returns _d_
and 2; if there is no punctuation, returns _n_ and 1; if
conversion fails due to a character that is neither a
digit nor punctuation, returns 0 (false).
OCTAL ( -- )
Set `BASE` for octal (base 8) number conversions on input
and output.
OFF ( addr -- )
Set the flag at _addr_ to false.
ON ( addr -- )
Set the flag at _addr_ to true.
PAUSE ( -- )
Relinquish the CPU briefly (typically about a
millisecond), while checking for messages if the task has
a message queue.
PERSONALITY ( "name" -- )
Define a serial device personality, allocating an
appropriate amount of space for it and initializing all
its vectors to "do-nothing" behaviors with suitable stack
effects. Execution of _name_ returns the address of the
beginning of its table.
PLACE ( addr1 u addr2 -- )
Put the string at _addr1_, whose length is _u_, at _addr2_,
formatting it as a counted string (count in the first
byte). Does not check to see if space is allocated for
the final string, whose length is _n_+1.
POPPATH ( -- )
Pop the top path from the directory stack to become the
new current path.
PROGRAM ( "filename[.ext]" -- )
Record a "snapshot" of the current running system in the
current path (or in the path specified with _filename_). If
the optional file extension is omitted, .exe will be
assumed and a bootable .EXE file will be built. If you
choose to specify it, you may use either .exe or .dll.
PROGRESS-NAME ( addr -- )
Display the ASCIIZ string, whose address is given, in the
title bar (replacing any previous title).
PROGRESS-TEXT ( addr -- )
Display the ASCIIZ string, whose address is given, in the
text field below the progress area.
PUSHPATH ( -- )
Push the current directory path onto the directory stack.
RELEASE ( addr -- )
Relinquish the facility variable at _addr_. If the task
executing `RELEASE` did not previously own the facility,
this operation is a no-op.
REMEMBER ( "name" -- )
Create a dictionary entry for _name_, to be used as a
deletion boundary. When _name_ is executed, it will remove
all subsequent definitions from the dictionary and
execute all `:PRUNE` definitions (beginning with the
earliest) to restore the system to the state it was in
when name was defined. Note that name remains in the
dictionary, so it can be used repeatedly.
RESUME ( addr -- )
Cause the task whose TCB is at addr to resume operation
at the point at which it was `SUSPEND`ed.
RUNS ( switch-sys addr n "word" -- switch-sys addr )
Add an entry to a switch structure whose key value is _n_
and whose associated behavior is the previously defined
word. The parameters _switch-sys_ and _addr_ are used
internally during construction of the switch.
S>F ( n -- )( F: -- r )
Remove a 32-bit value from the data stack and push it on
the floating-point stack.
SBLEFT ( n -- addr )
Return the address of the cell containing the xt of the
behavior for a left mouse click in status bar part _n_.
SBRIGHT ( n -- addr )
Return the address of the cell containing the xt of the
behavior for a right mouse click in status bar part _n_.
SCI ( n -- )
Configure `N.` to use the `FS.` output format with _n_
significant digits.
SEC ( -- )( F: x -- r )
Return the secant of _x_, where _x_ is in degrees.
SEE ( "name" -- )
Disassemble _name_.
SEPARATOR ( -- )
Add a separator bar at the current position in a menu.
Must be used within a menu or sub-menu definition.
SERVER ( "name" -- )
Set the string _name_ as the server identifier.
SF+! ( addr -- )( F: r -- )
The 32-bit equivalent of `F+!`. "Short floating plus store"
SFCONSTANT ( "name" -- )( F: r -- )
Define a floating-point constant with the given name
whose value is _r_, compiled in short (32-bit) format.
When _name_ is executed, _r_ will be returned on the
floating-point stack.
SFI@ ( addr -- )( F: -- r)
Push on the floating-point stack the 32-bit data
specified by the address on the data stack. "Single
fetch"
SFLITERAL ( -- )( F: r -- )
Compile the number on the floating-point stack as a
32-bit floating-point literal.
SFVARIABLE ( "name"-- )
Define a floating-point variable with the given name,
allocating space to store values in short (32-bit)
format. When name is executed, the address of its data
space will be returned on the data stack.
SILENT ( -- )
Disable the `INCLUDE` monitor.
SIN ( -- )( F: x -- r )
Return the sine of _x_, where _x_ is in degrees.
Sleep ( n -- )
Relinquish the CPU for approximately _n_ milliseconds. If _n_
is zero, the task relinquishes the rest of its time slice
(typically about 10 milliseconds). `Sleep` is a Windows
call used by `MS` and `PAUSE`, and is appropriate when the
task wishes to avoid checking its message queue.
SMATRIX ( nr nc "name" -- )
Construct a matrix containing space for _nr_ rows and _nc_
columns, with 32 bits per entry.
SMD ( nr nc "name" -- )
Display a previously defined short (32-bit entries)
matrix. The number of rows and columns must agree with
the number in the definition.
STARTER ( "wordname" -- )
When used before `PROGRAM`, specifies that when the turnkey
is launched it will automatically execute _wordname_
following its default initialization. This may be used to
provide application-specific initialization.
STOP ( -- )
Check for messages (if the task has a message queue) and
suspend operation indefinitely (until restarted by
another task).
STRING, ( addr u -- )
Compile the string at _addr_, whose length is _u_, in the
dictionary starting at `HERE`, and allocate space for it.
SUSPEND ( addr -- )
Force the task whose TCB is at _addr_ to suspend operation
indefinitely.
SWITCH] ( switch-sys addr -- )
Terminate a switch structure (or the latest additions to
it) by marking the end of its linked list. _switch-sys_ and
_addr_ are used while building the structure; they are
discarded by `SWITCH]`.
S\" ( "string" -- addr n )
Compile a string, returning its address and length. The
string may contain a `\` followed by one or more characters
which will be converted into a control or other special
character according to the transformations listed in
Table 15.
TAN ( -- )( F: x -- r )
Return the tangent of _x_, where _x_ is in degrees.
TASK ( n "taskname" -- )
Define a task, whose combined user area and data stack
will be _n_ bytes (4,096 minimum) in size. Invoking
_taskname_ returns the address of the task's Task Control
Block (TCB).
TERMINATE ( -- )
Causes the task executing this word to cease operation
and release all its memory back to Windows. A task that
terminates itself may be re-activated.
TIME ( -- )
Display the current system time.
TIMER ( u -- )
Repeat `COUNTER`, then subtract the two values and display
the interval between the two in milliseconds.
TOPIC ( "string" -- )
Set _string_ as the topic.
U" ( "string" -- addr )
Compile a Unicode string, returning its address. The
string consists of 16-bit characters, with an ASCII code
in the low-order byte and zero in the high-order byte.
UBETWEEN ( u1 u2 u3 -- flag )
Test for _u2_ <= _u1_ <= _u3_. Similar to `WITHIN` but tests only
unsigned integers and is inclusive of both _u2_ and _u3_.
uCOUNTER ( -- d )
Return the current value of the microsecond timer.
UNCALLED ( -- )
List all words that have never been called in a colon
definition.
uTIMER ( d -- )
Repeat `uCOUNTER`, then subtract the two values and display
the interval between the two in microseconds.
U\" ( "string" -- addr )
Compile a Unicode _string_, returning its address. The
string may contain a `\` followed by one or more characters
which will be converted into a control or other special
character according to the transformations listed in
Table 15.
VERBOSE ( -- )
Enables the `INCLUDE` monitor, with a default behavior of 4
(display the text of each line).
WARNING ( -- addr )
Return the address of the flag that controls compiler
redefinition warnings. If it is true, warnings will be
issued.
WATCH ( addr -- )
Add _addr_ to the list of cells being monitored as watch
points, and launch the watch window if it is not already
active. The contents of _addr_ will be displayed in the
number base that is current when `WATCH` is invoked.
WH ( "name" -- )
Synonym of `WHERE`.
WHERE ( "name" -- )
Display a cross-reference showing the definition of _name_
and each line of source in which _name_ is used in the
currently compiled program. `WH` and `WHERE` are synonyms.
WINERROR ( -- addr u )
Following a Windows exception caught by `CATCH`, return the
address and length of the string, provided by Windows,
that identifies the exception.
WPARAM ( -- n )
Return the third parameter for the current message. Its
content is message-dependent.
Z" ( "string" -- addr )
Compile a zero-terminated string, returning its address.
ZAPPEND ( addr1 u addr2 -- )
Append the string at _addr1_, of length _u_, to the
zero-terminated string already existing at _addr2_. Does
not check to see if space is allocated for the final
string.
ZERO ( x -- 0 )
Replace the top stack item with the value 0 (zero).
ZPLACE ( addr1 u addr2 -- )
Put the string at _addr1_ , whose length is _u_, at _addr2_ as
a zero-terminated string. Does not check to see if space
is allocated for the final string.
Z\" ( "string" -- addr )
Compile a zero-terminated string, returning its address.
The string may contain a `\` followed by one or more
characters which will be converted into a control or
other special character according to the transformations
listed in Table 15.
[+ASSEMBLER] ( -- )
Add the assembler vocabulary to the top of the current
search order. An immediate word (will be executed
immediately when used inside a colon definition).
[+FORTH] ( -- )
Add the main Forth vocabulary to the top of the current
search order. An immediate word (will be executed
immediately when used inside a colon definition).
[+SWITCH ( "name" -- switch-sys addr )
Open the switch structure name to include additional list
entries. The default behavior remains unchanged. The
additions, like the original entries, are terminated by
`SWITCH]`. _switch-sys_ and _addr_ are used while building the
structure; they are discarded by `SWITCH]`.
[C ( -- )
Begin a critical section. Other SwiftForth tasks cannot
execute during a critical section.
[MENU ( "name" -- )
Start building the data structure for a menu. Terminated
by `MENU]`. Between `[MENU` and `MENU]` may be sub-menus
described with `[POPUP ... POPUP]` and individual menu items.
Use of _name_ will return the data structure's address.
[POPUP ( "label" -- )
Start building a popup sub-menu whose definition will be
terminated by `POPUP]`. Between `[POPUP` and `POPUP]` may be
individual menu items. The sub-menu will appear as _label_
on the parent menu. Sub-menus may be nested.
[PREVIOUS] ( -- )
Remove the top of the current search order. Often used to
"undo" `[+FORTH]` or `[+ASSEMBLER]`. An immediate word (will
be executed immediately when used inside a colon
definition).
[SWITCH ( "name" -- switch-sys addr )
Start the definition of a switch structure consisting of
a linked list of single-precision numbers and associated
behaviors. The switch definition will be terminated by
`SWITCH]`, and can be extended by `[+SWITCH`. See the
discussion above for syntax.
_switch-sys_ and _addr_ are used while building the
structure; they are discarded by `SWITCH]`.
The behavior of _name_ when invoked is to take the number
on the stack, and search the list for a matching value.
If a match is found, the corresponding behavior will be
executed; if not, the switch's default behavior will be
executed with the value on the stack.
\\ ( "..." -- )
During an `INCLUDE` operation, treat anything following
this word as a comment; i.e., anything that follows `\\`
in a source file will not be compiled.
`_PARAM_4, _PARAM_5, _PARAM_6, _PARAM_7` ( -- n )
Return the fifth through the eighth parameters for the
current message, respectively. The content of each is
message-dependent.
{ ( -- )
Begin a comment that may extend over multiple lines,
until a terminating right brace `}` is encountered.
~!+ ( x addr -- addr+4 )
Write the value _x_ to addr, and increment the address by
one cell (accepts the parameters in reverse order
compared to `!+`).
------------------------------------------------------- [THEN]