VFHandbuchChapter5
Back to current versionRestore this version

Input / Output in Volks-FORTH#

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:

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:

Ein- / Ausgabe von Zahlen#

Die Eingabe von Zahlen erfolgt im interpretativen Modus über die Tastatur, wobei grundlegende Eingabeworte mit number numbers und den verwandten Worten definiert werden. Bei der Ausgabe von Zahlen ist wieder die fehlende Typisierung von FORTH zu beachten — für ein bestimmtes Datenformat (integer, unsigned, double) ist jeweils der geeignete Operator auszuwählen.

Input / output via a port#

MS-DOS

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.