!!!Input / Output in Volks-FORTH

[{TableOfContents }]

!! Input / output commands in VolksFORTH

All input and output words (__KEY__ __EXPECT__ __EMIT__ __TYPE__ etc.) are vectorized in the people-FORTH, ie when called, the code field address of the associated command is taken from a table and executed. It is included in the system table wine named DISPLAY, which provides for the output to the screen terminal.

This method of vectorization offers significant benefits:

* Nit-vectorization of the input can e.g. switch with one stroke of the keyboard on the input of a modem.
* The output can vectorization with a new table, the total expenditure to another device (eg a printer) will be conducted without having to change the output commands themselves.
* In a word (__DISPLAY__, __PRINT__) can all be changed spending habits. Is there such a (((print a list display))) will be issued a screen on a printer, and then falls back to the screen. So you need a new word, such PRINTERLIST to define.

A new table is created with the word __OUTPUT: __. The definition can output with (((view:)) look). __OUTPUT: __ Expected to issue a list of words, with must, be completed.

Beipsiel:
{{{
Output:> PRINTER
   pemit pcr ptype pdel PPAG pat pat? ;
}}}

For a new table named __> PRINTER__ is created. With a later call to PRINTER__ __> is the address of this table in the Uservariable __OUTPUT__
written. From now leads __EMIT__ from a __PEMIT__, a __PTYPE__ __TYPE__ etc.

The order of words after __OUTPUT: __
userEMIT userCR userType userdel Userpage userAT userAT?
must necessarily be met. Accordingly, the input-vectorization is handled.

! Input / output terminal on

The state-FORTH has a number of constants which serve to improve readability:

* [C / row | characters-per-row]
* [C / col | characters-per-column]
* [C / dis | characters-per-display]
* [C / l | characters-per-line]
* [L / s | lines-per-screen]
* [Bl]
* [# Esc | number-escape]
* [# Cr | number-carriage-return]
* [# Lf | number-linefeed]
* [# Bel | number-bell]
* [# Bs | number-backspace]
* [Standardized / o | standard input-output]
* [Inputkol]
* [Outputkol]
* [Area]
* [Areakol]
* [] Terminal
* [Window]
* [Full]
* [Curat? | Cursor-at-question]
* [Cur! | Cursor-store]
* [Setpage]
* [@ Video | video-fetch]
* [Savevideo]
* [Restorevideo]
* [Catt]
* [List]
* [(Page | paren-page]
* [Page]
* [(Del | paren-delete]
* [Del]
* [(Cr | paren-carriage-return]
* [Cr]
* [? Cr | question-carriage-return]
* [(At | paren-us]
* [(At? | Paren-at-question]
* [At]
* [At? | At-question]
* [Col]
* [Row]
* [] Curoff
* [Curon]
* [Curshape]
* [Printer]
* [Print]
* [+ | Print plus-print]
* [Ls! | List-store]

! Input / output of numbers

The input of numbers is made in the interpretive mode via the keyboard, and basic input words are defined with __number__ __numbers__ and related words. For the issue of numbers again is the lack of typing of FORTH observed - for a specific data format (integer, unsigned, double) is appropriate in each case the operator to select.

* [. | Dot]
* [U. | unsigned-dot]
* [D | double-dot]
* [. R | dot-right-justified]
* [U.r | unsigned-dot-right-justified]
* [D.r | double-dot-right-justified]

! Input / output via a port

MS-DOS''''
* [Pc @ | port-char-fetch]
* [PC! | Port-char-store]

! Enter characters

In FORTH you will always designate a storage area, incorporated into the characters and strings. To do this you usually use a small, 80-character memory area called __PAD__. This note pad - so the German translation of pad used - no fixed memory area and is both the FORTH system and the programmers.

Then I liked you with the text input buffer __TIB__ another important Speicherberelch imagine that ensures the reasonable use of the connected devices. Because the text input via the keyboard vorsichgeht relatively slow, the characters are collected here only in a free space, the buffer __TIB__, and then processed.

* [tib]
* [#tib|number-tib]
* [>tob|to-tib]
* [>in|to-in]
* [pad]
* [input]
* [keyboard]
* [empty-keys]
* [(key?|paren-key-question]
* [key?|key-question]
* [(key|paren-key]
* [key]
* [(decode|paren-decode]
* [(expect|paren-expect]
* [expect]
* [span]
* [>expect|to-expect]
* [nullstring?|nullstring-question?]
* [stop?|stop-question]
* [source]
* [word]
* [parse]
* [name]
* [find]
* [execute]
* [perform]
* [query]
* [interpret]
* [output]
* [display]
* [(emit|paren-emit]
* [emit]
* [charout]
* [tipp]
* [(type|paren-type]
* [type]
* [ltype|long-type]
* [space]
* [spaces]