--- a/FIO2.def
+++ b/FIO2.def
@@ -4,9 +4,6 @@
(* Fileorientierte Lese- und Schreibprozeduren. *)
(* *)
(* File oriented read and write procedures. *)
- (* For a description please see "SIO.def" - the only difference is that *)
- (* routines is this module use unbuffered files as the output or input *)
- (* device. *)
(*------------------------------------------------------------------------*)
(* Implementation : Michael Riedl *)
(* Licence : GNU Lesser General Public License (LGPL) *)
@@ -55,9 +52,14 @@
(*----------------------------------------------------------------*)
(* Lie\3t solange Zeichen von der Datei Ein, bis eine Zeichen- *)
(* kette beginnt. Ab da wird bis EOL oder dem ersten Trennzeichen *)
- (*(' ',CHAR(9)) gelesen. *)
+ (* (' ',CHAR(9)) gelesen. *)
(* Wird dabei HIGH(Wort)-1 "uberschritten, wird die bis dahin *)
(* gelesene Zeichenkette zur"uckgegeben. *)
+ (* *)
+ (* Reads charactes from stream "Datei" until a string begins. *)
+ (* The reads to string "Wort" until the next delimiter *)
+ (* (' ',ASCII.lf,ASCII.tab). If the string is too long long *)
+ (* to be placed in "Wort" it will be truncated *)
(*----------------------------------------------------------------*)
PROCEDURE ReadLine(VAR Ein : File; VAR Line : ARRAY OF CHAR);
@@ -65,12 +67,17 @@
(*----------------------------------------------------------------*)
(* Einlesen aller Zeichen der aktuellen Zeile aus der Datei Ein *)
(* bis EOL erreicht ist. *)
+ (* *)
+ (* Reads all characters in the actual line from stream "Ein" *)
+ (* until EOL is reached *)
(*----------------------------------------------------------------*)
PROCEDURE WrLn(Datei : File);
(*----------------------------------------------------------------*)
(* Schreibt End-of-Line Marke auf die Textdatei 'Datei'. *)
+ (* *)
+ (* Write a newline to stream "Datei" *)
(*----------------------------------------------------------------*)
PROCEDURE WrLnN(Datei : File;
@@ -78,6 +85,8 @@
(*----------------------------------------------------------------*)
(* Schreibt n End-of-Line Marken auf die Textdatei 'Datei'. *)
+ (* *)
+ (* Write "n" times a newline to stream "Datei" *)
(*----------------------------------------------------------------*)
PROCEDURE RdChar( Datei : File;
@@ -85,6 +94,12 @@
(*----------------------------------------------------------------*)
(* Liest den CHAR chr von der Textdatei 'Datei'. *)
+ (* Wenn ein Zeilenumbruch anliegt wird CommonIO.EoL zurueckge- *)
+ (* geben, wenn das Dateiende erreicht wurde CommonIO.EoF. *)
+ (* *)
+ (* Reads character "chr" from file "Datei". In case end of line *)
+ (* is reached CommonIO.EoL, in case the end of the file is *)
+ (* reached CommonIO.EoF will be returned. *)
(*----------------------------------------------------------------*)
PROCEDURE WrChar(Datei : File;
@@ -94,6 +109,8 @@
(* Schreibt den CHAR chr auf die Text-Datei Datei. *)
(* Wenn chr = EoL wird dies in cl,lf "ubersetz, wenn in CommonIO *)
(* die Variable CrLf auf TRUE gesetzt ist. *)
+ (* *)
+ (* Writes character "chr" to file "Datei" *)
(*----------------------------------------------------------------*)
PROCEDURE WrCharN(VAR Aus : File;
@@ -102,6 +119,8 @@
(*----------------------------------------------------------------*)
(* Schreibt das Zeichen chr Anzahl mal aus. *)
+ (* *)
+ (* Write character "chr" "Anzahl" times to stream "Aus" *)
(*----------------------------------------------------------------*)
PROCEDURE RdStr( Datei : File;
@@ -109,6 +128,8 @@
(*----------------------------------------------------------------*)
(* Liest den String Wort von der Textdatei 'Datei'. *)
+ (* *)
+ (* Reads String "Wort" from file "Datei" *)
(*----------------------------------------------------------------*)
PROCEDURE WrStr(Datei : File;
@@ -116,6 +137,8 @@
(*----------------------------------------------------------------*)
(* Schreibt den Zeichenkette Wort auf die Text-Datei Datei. *)
+ (* *)
+ (* Writes String "Wort" to file "Datei" *)
(*----------------------------------------------------------------*)
PROCEDURE WrStrForm(VAR Aus : File;
@@ -129,6 +152,11 @@
(* angeh"angt (Breite < 0). Ist die L"ange von Str gr"o3er als *)
(* Breite wird Str unver"andert ausgegeben (d.h. es wird dann *)
(* "uber die angeforderte Breite hinaus geschrieben). *)
+ (* *)
+ (* Wrties string "Str" to file "Aus" with a minimal width of *)
+ (* "Breite" characters. If "Breite" > 0 the field will be left *)
+ (* padded with blanks, if "Breite" < 0 right padding is done. *)
+ (* If Breite is not sufficient the field will be expanded ! *)
(*----------------------------------------------------------------*)
PROCEDURE RdCard( Datei : File;
@@ -136,6 +164,10 @@
(*----------------------------------------------------------------*)
(* Liest CARDINAL-Zahl c von der Textdatei 'Datei'. *)
+ (* Im Fehlerfalle wird MAX(CARDINAL) zur"uckgegeben und *)
+ (* *)
+ (* Reads cardinal value "c" form "Datei". In case of an error *)
+ (* MAX(CARDINAL) is returned. *)
(*----------------------------------------------------------------*)
PROCEDURE WrCard(Datei : File;
@@ -146,6 +178,10 @@
(* Schreibt CARDINAL-Zahl c auf die Textdatei 'Datei'. *)
(* Falls die Feldbreite zu klein zur Darstellung der Zahl c ist, *)
(* wird Feldbreite auf die Mindestanzahl von Zeichen erweitert ! *)
+ (* *)
+ (* Write value "c" to file "Datei" with a field width of "n". *)
+ (* If n is choosen too small it will be expanded to the mininal *)
+ (* value needed to represent c. *)
(*----------------------------------------------------------------*)
PROCEDURE RdHex( Datei : File;
@@ -155,6 +191,9 @@
(* Liest CARDINAL-Zahl c von der Textdatei 'Datei' in hexa- *)
(* dezimaler Form. Im Fehlerfalle wird MAX(CARDINAL) zur"uck- *)
(* gegeben. *)
+ (* *)
+ (* Reads "c" from "Datei" in hexadecimal representation *)
+ (* In case of an error MAX(CARDINAL) is returend. *)
(*----------------------------------------------------------------*)
PROCEDURE WrHex(Datei : File;
@@ -166,6 +205,8 @@
(* dezimaler Form. *)
(* Falls die Feldbreite zu klein zur Darstellung der Zahl c ist, *)
(* wird Feldbreite auf die Mindestanzahl von Zeichen erweitert ! *)
+ (* *)
+ (* Writes "c" to "Datei" in hexadecimal representation *)
(*----------------------------------------------------------------*)
PROCEDURE WrBits(Datei : File;
@@ -174,9 +215,18 @@
(*----------------------------------------------------------------*)
(* Schreibt die ersten nbits BITS der CARDINAL-Zahl c in die *)
- (* Textdate "Datei". *)
- (* Falls die Feldbreite zu klein zur Darstellung der Zahl c ist, *)
- (* wird Feldbreite auf die Mindestanzahl von Zeichen erweitert ! *)
+ (* Textdate "Datei". Das hoechstwertigste Bit wird dabei zuerst *)
+ (* ausgegeben. Falls die Feldbreite zu klein zur Darstellung der *)
+ (* Zahl c ist, wird Feldbreite auf die Mindestanzahl von Zeichen *)
+ (* erweitert ! *)
+ (* *)
+ (* Beispiel: c = 13, nbits = 5 , Ausgabe ist "01101" *)
+ (* *)
+ (* Writes the first nbits bit of "c" to "Datei". The bit with *)
+ (* highst value is printed first. If nbits is choosen too small *)
+ (* the field will be expanded ! *)
+ (* *)
+ (* example : c = 13, nbits = 5 , output is "10110" *)
(*----------------------------------------------------------------*)
PROCEDURE RdOct( Datei : File;
@@ -186,6 +236,8 @@
(* Liest CARDINAL-Zahl c von der Textdatei 'Datei' in okta- *)
(* dezimaler Form. *)
(* Im Fehlerfalle wird MAX(CARDINAL) zur"uckgegeben. *)
+ (* *)
+ (* Reads "c" from "Datei" in octal notation form *)
(*----------------------------------------------------------------*)
PROCEDURE WrOct(Datei : File;
@@ -197,6 +249,8 @@
(* dezimaler Form. *)
(* Falls die Feldbreite zu klein zur Darstellung der Zahl c ist, *)
(* wird Feldbreite auf die Mindestanzahl von Zeichen erweitert ! *)
+ (* *)
+ (* Writed "c" to file "Datei" in octal notation form *)
(*----------------------------------------------------------------*)
PROCEDURE RdLngCard( Datei : File;
@@ -204,6 +258,9 @@
(*----------------------------------------------------------------*)
(* Liest LONGCARD-Zahl C von der Textdatei 'Datei'. *)
+ (* *)
+ (* Reads value "C" form "Datei". In case of an error *)
+ (* MAX(CARDINAL) is returned. *)
(*----------------------------------------------------------------*)
PROCEDURE WrLngCard(Datei : File;
@@ -214,6 +271,10 @@
(* Schreibt LONGCARD-Zahl C auf die Textdatei 'Datei'. *)
(* Falls die Feldbreite zu klein zur Darstellung der Zahl C ist, *)
(* wird Feldbreite auf die Mindestanzahl von Zeichen erweitert ! *)
+ (* *)
+ (* Write value "C" to file "Datei" with a field width of "n". *)
+ (* If n is choosen too small it will be expanded to the mininal *)
+ (* value needed to represent c. *)
(*----------------------------------------------------------------*)
PROCEDURE RdInt( Datei : File;
@@ -221,6 +282,9 @@
(*----------------------------------------------------------------*)
(* Liest Integer-Zahl i von der Textdatei 'Datei'. *)
+ (* *)
+ (* Reads value "i" form "Datei". In case of an error MAX(INTEGER) *)
+ (* is returned and Datei.res is set to "notdone" *)
(*----------------------------------------------------------------*)
PROCEDURE WrInt(Datei : File;
@@ -229,6 +293,8 @@
(*----------------------------------------------------------------*)
(* Schreibt Integer-Zahl i auf die Textdatei 'Datei'. *)
+ (* *)
+ (* Writes the value "i" to "Datei" with a field width of "n" *)
(*----------------------------------------------------------------*)
PROCEDURE WrLngInt(Datei : File;
@@ -237,6 +303,8 @@
(*----------------------------------------------------------------*)
(* Schreibt Integer-Zahl I auf die Textdatei 'Datei'. *)
+ (* *)
+ (* Same as WrInt for LONGINT values *)
(*----------------------------------------------------------------*)
PROCEDURE RdLngReal( Datei : File;
@@ -245,6 +313,11 @@
(*----------------------------------------------------------------*)
(* Liest Real-Zahl x von der Textdatei 'Datei'. *)
(* Syntax : Siehe RealConvert.StingToReal. *)
+ (* *)
+ (* Reads real value "x" form "Datei". In case of an error *)
+ (* MAX(LONGREAL) is returned (should be NAN) *)
+ (* For the syntax of a value x please refer to *)
+ (* RealConvert.StringToReal *)
(*----------------------------------------------------------------*)
PROCEDURE WrLngReal(Datei : File;
@@ -253,8 +326,16 @@
Komma : INTEGER); (* Nachkommastellen *)
(*----------------------------------------------------------------*)
- (* Schreibt LONGREAL-Zahl x auf die Textdatei 'Datei'. *)
- (* Wenn (Komma < 0) ==> EXP-Darstellung *)
+ (* Schreibt Real-Zahl x auf die Textdatei 'Datei'. *)
+ (* Wenn (m < 0) ==> EXP-Darstellung. Es werden "Komma" Nachkomma- *)
+ (* stellen in einem Feld der Gesamtbreite "Breite". Wenn eine *)
+ (* Darstellung nicht moeglich ist wird das Feld mit "*" gefuellt *)
+ (* ("ahnlich Fortran) *)
+ (* *)
+ (* Write real value "x" to "Datei" with "Komma" decimal digits *)
+ (* and a field width of "Breite". If Komma < 0 exponential *)
+ (* representation is used. In case the value is not representable *)
+ (* the entire field is filled by "*" (similar to Fortran) *)
(*----------------------------------------------------------------*)
PROCEDURE WrReal(Datei : File;
@@ -265,6 +346,8 @@
(*----------------------------------------------------------------*)
(* Schreibt Real-Zahl x auf die Textdatei 'Datei'. *)
(* Wenn (Komma < 0) ==> EXP-Darstellung *)
+ (* *)
+ (* Similar to WrLngReal for "REAL" values. *)
(*----------------------------------------------------------------*)
PROCEDURE WrLngCmplx(Datei : File;
@@ -276,6 +359,9 @@
(* Schreibt Complex-Zahl x auf die Textdatei 'Datei'. *)
(* Wenn (Komma < 0) ==> EXP-Darstellung. *)
(* Breite, Komma beziehen sich auf Einzelkomponenten von x. *)
+ (* *)
+ (* Write a long complex value to Datei. For "Breite" and "Komma" *)
+ (* see WrLngReal. *)
(*----------------------------------------------------------------*)
PROCEDURE WrBool(Datei : File;
@@ -283,6 +369,8 @@
(*----------------------------------------------------------------*)
(* Schreibt den BOOLEAN - Ausdruck Bool als String (TRUE/FALSE) *)
+ (* *)
+ (* Write "TRUE " or "FALSE" debending on the value of "Bool" *)
(*----------------------------------------------------------------*)
PROCEDURE RdBin( Datei : File;
@@ -291,6 +379,9 @@
(*----------------------------------------------------------------*)
(* Lie\3t beliebiges Objekt (Real,Integer,Cardinal,Array,Record *)
(* etc.) bin"ar von der Datei "Datei". *)
+ (* *)
+ (* Read an abitrary Objekt (Real,Integer,Cardinal,Array,Record *)
+ (* etc.) in binary form form file "Datei". *)
(*----------------------------------------------------------------*)
PROCEDURE WrBin( Datei : File;
@@ -299,6 +390,9 @@
(*----------------------------------------------------------------*)
(* Schreibt beliebiges Objekt (Real,Integer,Cardinal,Array,Record *)
(* etc.) bin"ar auf die Datei "Datei". *)
+ (* *)
+ (* Write an abitrary Objekt (Real,Integer,Cardinal,Array,Record *)
+ (* etc.) in binary form to file "Datei". *)
(*----------------------------------------------------------------*)
END FIO2.