🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #5163

Re: basic to pascal (mks$ in particular)

#5163
From: Bruce Leung
Date: Wed, 13 Mar 1991 05:14
32 lines
2105 bytes
shaunc@gold.gvg.tek.com (Shaun Case) writes:
>leung@sp1.csrd.uiuc.edu (Bruce Leung) writes:
>>I'm trying to read a data file that was written using the mks$ function
>>in Basic.  Actually, I assume it was written using that since the only
>>code I have is a Basic program to read the file (shown below).
>
>Perhaps you could modify the code you have to read in the data, 
>then print it back out as strings.  If so, then you can read it
>in in C or Pascal and convert it that way, once.

That would work but I don't want to convert the files.  I want to be able
to read the files that are created by another program, possibly manipulate
the data, and write it back.  Using Basic is not an option.

The problem is that Turbo Pascal uses 6 bytes for the REAL type.  I tried
using the SINGLE type that uses 4 bytes (yes, I have a coprocessor) but
wasn't successful.  It is quite likely I was doing something wrong.  (Hence
my request to the collective net wisdom.)

>If you want to use C, take a look at fscanf(), or better yet, 
>fgets() and sscanf().

I'm familiar with C.  To tell you the truth, I haven't tried C yet (head
hung in shame) since I do want to do this in Turbo Pascal.

Thanks for your suggestions though.

Bruce

-----------------------------------------------------------------------------
Bruce Leung    bleung@uiuc.edu | Women and cats do as they damn well please.
University of Illinois         | Men and dogs had best learn to live with it.
Technical Details
Message-ID: <1991Mar13.051427.18507@csrd.uiuc.edu>
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!mp.cs.niu.edu!ux1.cso.uiuc.edu!csrd.uiuc.edu!sp17.csrd.uiuc.edu!leung
References: <1991Mar12.203014.14472@csrd.uiuc.edu> <2065@gold.gvg.tek.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!mp.cs.niu.edu!ux1.cso.uiuc.edu!csrd.uiuc.edu!sp17.csrd.uiuc.edu!leung
From: leung@sp17.csrd.uiuc.edu (Bruce Leung)
Newsgroups: comp.os.msdos.programmer
Subject: Re: basic to pascal (mks$ in particular)
Message-ID: <1991Mar13.051427.18507@csrd.uiuc.edu>
Date: 13 Mar 91 05:14:27 GMT
References: <1991Mar12.203014.14472@csrd.uiuc.edu> <2065@gold.gvg.tek.com>
Sender: news@csrd.uiuc.edu (news)
Distribution: na
Organization: Center for Supercomputing R&D, U. of Ill.
Lines: 32