Parent: [c017f0] (diff)

Child: [8d1c2d] (diff)

Download this file

SFormEin.def    101 lines (84 with data), 5.9 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
DEFINITION MODULE SFormEin;
(*------------------------------------------------------------------------*)
(* Modul fuer das formatierte Einlesen von Daten - dient der Simulation *)
(* von FORTRAN "formatted input" *)
(* Modul for formatted reading from a file - it is used to simulate *)
(* FORTRAN "formatted input" *)
(*------------------------------------------------------------------------*)
(* Implementation : Michael Riedl *)
(* Licence : GNU Lesser General Public License (LGPL) *)
(*------------------------------------------------------------------------*)
(* $Id: SFormEin.def,v 1.1 2015/09/13 20:48:41 mriedl Exp mriedl $ *)
FROM Streams IMPORT Stream;
PROCEDURE RdLn(VAR Ein : Stream);
(*----------------------------------------------------------------*)
(* Lie\3t aus der Datei 'Ein', bis das Zeilenende erreicht ist *)
(* und setzt dann die globale Variable EoL auf FALSE. *)
(* *)
(* Read the file Ein until a line end is read and then sets the *)
(* global variable Streams.EoL to falsglobal variable Streams.EoL *)
(* to false *)
(*----------------------------------------------------------------*)
PROCEDURE RdItemF(VAR Ein : Stream;
VAR Str : ARRAY OF CHAR;
Breite : CARDINAL);
(*----------------------------------------------------------------*)
(* Lie\3t von der Datei 'Ein' einen String der L"ange Breite, *)
(* wobei dieser erst in der Position Breite mit 0C abge- *)
(* schlossen wird. *)
(* *)
(* Reads from file "Ein" a string "Str" of length "Breite". The *)
(* string will be terminated at position "Breite" with 0C. *)
(*----------------------------------------------------------------*)
PROCEDURE RdStrF(VAR Ein : Stream;
VAR Str : ARRAY OF CHAR;
Breite : CARDINAL);
(*----------------------------------------------------------------*)
(* Lie\3t von der Datei 'Ein' einen String der L"ange Breite, *)
(* wobei dieser beim ersten Trennzeichen mit 0C abgeschlossen *)
(* wird. *)
(* *)
(* Reads from file "Ein" a string "Str" of length "Breite". The *)
(* string will be terminated at position "Breite" with 0C or *)
(* if the first termination char is read (" ", "tab", EOL, EOF) *)
(*----------------------------------------------------------------*)
PROCEDURE RdCardF(VAR Ein : Stream;
VAR c : CARDINAL;
Breite : CARDINAL);
(*----------------------------------------------------------------*)
(* Liest CARDINAL-Zahl i formatiert von der Textdatei 'Ein'. *)
(* Daber werden immer "Breite" Zeichern eingelesen, ganz gleich *)
(* wo der gesuchte Zahlstring in betrachteten Feld positioniert *)
(* ist. *)
(* *)
(* Reads a unsigned integer i in formatted way from file "Ein" *)
(* This means the procedure reads "Breite" number of char regard- *)
(* where the number string is actually positioned in that record *)
(*----------------------------------------------------------------*)
PROCEDURE RdLngRealF(VAR Ein : Stream;
VAR x : LONGREAL;
Breite : CARDINAL);
(*----------------------------------------------------------------*)
(* Liest Real-Zahl x formatiert von der Textdatei 'Ein'. *)
(* Dabei geleten dieselben Bemerkungen wie fuer die Prozedur *)
(* RdCardF *)
(* *)
(* Reads a real value form Ein in formatted way. See "RdCardF" *)
(* for more info. *)
(*----------------------------------------------------------------*)
PROCEDURE WrStrF(VAR Aus : Stream;
Str : ARRAY OF CHAR;
Breite : CARDINAL;
Form : CARDINAL);
(*----------------------------------------------------------------*)
(* Schreibt einen Zeichenkette rechtsb"undig (Form = 0) oder *)
(* linksb"undig (Form # 0) auf die Datei Aus. Die Breite wird *)
(* dabei auf jeden Fall eingehalten, es werden also Leerzeichen *)
(* eingef"ugt oder der String abgeschnitten. *)
(* *)
(* Write a string "Str" right adjusted (Form = 0) or left *)
(* adjusted (Form # 0) to the stream "Aus". The field width *)
(* "Breite" will be used in all cased, either by truncation or *)
(* by padding with blanks *)
(*----------------------------------------------------------------*)
END SFormEin.