I2010506%DBSTU1.BITNET@cunyvm.cuny.edu (02/20/90)
Date: 19 February 1990, 12:05:48 MEZ From: Christian Boettger +49 (0)531 3915113 / I2010506 at DBSTU1 To: info-pascal at vim.brl pascal-l at yalevm pascal-l at trearn pascal-l at uiucvmd pascal-l at ualtavm Date: Mon, 19 Feb 90 11:51:27 MEZ From: Christian Boettger <I2010506@DBSTU1> Subject: TP, input^ To: Borland PASCAL Discussion Group <pascal-l@yalevm>, PASCAL Language Discussion List <pascal-l@trearn>, "PASCAL (Language) Discussions" <pascal-l@uiucvmd>, "PASCAL (Language) Discussions" <pascal-l@ualtavm>, PASCAL news group <info-pascal@vim.brl> ======================================================================== Hi, some tome ago, there was a discussion about input^ in TP. Of course, this does not work. But I found a "trick" to read at least figures from an unstructured file. Hope it is of any interest ... Christian Boettger TURBO PASCAL procedure READ_VALUE The READVALUe UNIT for TP4.0 ++ is a unit that makes it possible to simulate the INPUT^ (Standard PASCAL) in TP. The PROCEDURE READ_VALUE is used just like the standard procedure READ, except that it works only on external TEXT files. Called once, it returnes the value of the NEXT figure in the input file, regardless of anything standing before that figure. Comments, SPACE, CR, LF and all other characters are skipped. The type of the returned value is EXTENDED, if you do not want this, change it. READ_VALUE does handle figures written by BASIC programs (".78" instead of "0.78") correctly. If you are trying to read a value after EOF, READ_VALUE returns zero as a value, so alway be sure to check EOF after calling READ_VALUE to assure that the returned value is indeed valid. In case of I/O-Error READ_VALUE displays the complete DOS error in plain text and prompts you for akey to press. This does ONLY work with DOS 3.0 or higher. In any other case, you are on your own for an error routine. READ_VALUE.TPU is compiled under TP5.5, if you have another version, you will have to re-compile the source code. Other sources included: Cursor_Vanish : makes the cursor vanish Cursor_Restore : restores the previous cursor Extended_Error_code : returnes the complete DOS error StandBy : waits for the user to press a key Thanks to all the people cited in the source code for their contributions. This is PUBLIC DOMAIN software. If you have any suggestions to improve this software, please contact me. Christian Bttger ________________________________________________________________________________ Christian Boettger phone: (+49) (0)531/391-5113 mail: Institut fuer Metallphysik und Nukleare Festkoerperphysik, (room -167/-168), Technische Universitaet Braunschweig, Mendelssohnstrasse 3, D-3300 Braunschweig, Bundesrepublik Deutschland; FRG / RFA ________________________________________________________________________________ EARN: I2010506DBSTU1.BITNET InterNet: boettgerria.ccs.uwo.CA boettgerrz.tu-braunschweig.dbp.DE X.400: S=boettger; OU=rz; P=tu-braunschweig; A=dbp; C=de; UUCP / UseNet: boettgerria.UUCP (whereever)|uunet|watmath|ria|boettger (whereever)|uunet|boettgerhydra.uwo.CA (whereever)|uunet|mcvax|unido|i2010506DBSTU1.BITNET ******************************************************************************** ________________________________________________________________________________ Christian Boettger phone: (+49) (0)531/391-5113 mail: Institut fuer Metallphysik und Nukleare Festkoerperphysik, (room -167/-168), Technische Universitaet Braunschweig, Mendelssohnstrasse 3, D-3300 Braunschweig, Bundesrepublik Deutschland FRG / RFA ________________________________________________________________________________ EARN: I2010506@DBSTU1.BITNET UseNet: boettger@ria.UUCP InterNet: boettger@ria.ccs.uwo.CA boettger@rz.tu-braunschweig.dbp.DE X.400: S=boettger; OU=rz; P=tu-braunschweig; A=dbp; C=de; UUCP / UseNet: (whereever)!uunet!watmath!ria!boettger (whereever)!uunet!boettger@hydra.uwo.CA (whereever)!uunet!mcvax!unido!i2010506@DBSTU1.BITNET ********************************************************************************