This is a page from DPANS'94, the Draft Proposal on ANS Forth 1994.
There are just additional cross-references to reserved words on a seperate page.
dpans
94

TOC


10. The optional Facility word set


10.1 Introduction


10.2 Additional terms and notation

None.


10.3 Additional usage requirements


10.3.1 Character types

Programs that use more than seven bits of a character by 10.6.2.1305 EKEY have an environmental dependency.

See: 3.1.2 Character types


10.3.2 Environmental queries

Append table 10.1 to table 3.5.

See: 3.2.6 Environmental queries

Table 10.1 - Environmental query strings

String          Value data type   Constant?   Meaning
------          ---------------   ---------   -------
FACILITY        flag              no          facility word set present
FACILITY-EXT    flag              no          facility extensions word set present


10.4 Additional documentation requirements


10.4.1 System documentation


10.4.1.1 Implementation-defined options


10.4.1.2 Ambiguous conditions


10.4.1.3 Other system documentation


10.4.2 Program documentation


10.4.2.1 Environmental dependencies


10.4.2.2 Other program documentation


10.5 Compliance and labeling


10.5.1 ANS Forth systems

The phrase Providing the Facility word set shall be appended to the label of any Standard System that provides all of the Facility word set.

The phrase Providing name(s) from the Facility Extensions word set shall be appended to the label of any Standard System that provides portions of the Facility Extensions word set.

The phrase Providing the Facility Extensions word set shall be appended to the label of any Standard System that provides all of the Facility and Facility Extensions word sets.


10.5.2 ANS Forth programs

The phrase Requiring the Facility word set shall be appended to the label of Standard Programs that require the system to provide the Facility word set.

The phrase Requiring name(s) from the Facility Extensions word set shall be appended to the label of Standard Programs that require the system to provide portions of the Facility Extensions word set.

The phrase Requiring the Facility Extensions word set shall be appended to the label of Standard Programs that require the system to provide all of the Facility and Facility Extensions word sets.


10.6 Glossary


10.6.1 Facility words


10.6.1.0742 AT-XY
at-x-y FACILITY
( u1 u2 -- )

Perform implementation-dependent steps so that the next character displayed will appear in column u1, row u2 of the user output device, the upper left corner of which is column zero, row zero. An ambiguous condition exists if the operation cannot be performed on the user output device with the specified parameters.

See: A.10.6.1.0742 AT-XY


10.6.1.1755 KEY?
key-question FACILITY
( -- flag )

If a character is available, return true. Otherwise, return false. If non-character keyboard events are available before the first valid character, they are discarded and are subsequently unavailable. The character shall be returned by the next execution of KEY.

After KEY? returns with a value of true, subsequent executions of KEY? prior to the execution of KEY or EKEY also return true, without discarding keyboard events.

See: A.10.6.1.1755 KEY?


10.6.1.2005 PAGE
FACILITY
( -- )

Move to another page for output. Actual function depends on the output device. On a terminal, PAGE clears the screen and resets the cursor position to the upper left corner. On a printer, PAGE performs a form feed.


10.6.2 Facility extension words


10.6.2.1305 EKEY
e-key FACILITY EXT
( -- u )

Receive one keyboard event u. The encoding of keyboard events is implementation defined.

See: 10.6.1.1755 KEY? , 6.1.1750 KEY , A.10.6.2.1305 EKEY


10.6.2.1306 EKEY>CHAR
e-key-to-char FACILITY EXT
( u -- u false | char true )

If the keyboard event u corresponds to a character in the implementation-defined character set, return that character and true. Otherwise return u and false.

See: A.10.6.2.1306 EKEY>CHAR


10.6.2.1307 EKEY?
e-key-question FACILITY EXT
( -- flag )

If a keyboard event is available, return true. Otherwise return false. The event shall be returned by the next execution of EKEY.

After EKEY? returns with a value of true, subsequent executions of EKEY? prior to the execution of KEY, KEY? or EKEY also return true, referring to the same event.


10.6.2.1325 EMIT?
emit-question FACILITY EXT
( -- flag )

flag is true if the user output device is ready to accept data and the execution of EMIT in place of EMIT? would not have suffered an indefinite delay. If the device status is indeterminate, flag is true.

See: A.10.6.2.1325 EMIT?


10.6.2.1905 MS
FACILITY EXT
( u -- )

Wait at least u milliseconds.

Note: The actual length and variability of the time period depends upon the implementation-defined resolution of the system clock and upon other system and computer characteristics beyond the scope of this Standard.

See: A.10.6.2.1905 MS R.10.6.2.1905 GETTIME / MS@


10.6.2.2292 TIME&DATE
time-and-date FACILITY EXT
( -- +n1 +n2 +n3 +n4 +n5 +n6 )

Return the current time and date. +n1 is the second {0...59}, +n2 is the minute {0...59}, +n3 is the hour {0...23}, +n4 is the day {1...31} +n5 is the month {1...12}, and +n6 is the year (e.g., 1991).

See: A.10.6.2.2292 TIME&DATE


Table of Contents
Next Section