comp.lang.ada
 help / color / mirror / Atom feed
From: Theodore Dennison <dennison@escmail.orl.mmc.com>
Subject: Re: Heterogeneous file I/O
Date: 1995/04/19
Date: 1995-04-19T00:00:00+00:00	[thread overview]
Message-ID: <3n347s$2h7@theopolis.orl.mmc.com> (raw)
In-Reply-To: 3mu5mb$ako@twonky.btv.ibm.com

pontius@twonky.btv.ibm.com (Dale Pontius) wrote:
>
>My most urgent 'real code' need begins with a Spice reader that
>reads the output of circuit simulators. Spice format is a real
>son-of-a-gun, in that there is a simple ASCII header which defines
>the size data type, and labels for a two dimensional array of
>data which follows. (at some arbitrary offset into the file, of
>course.) With some local extensions, it's even possible for more
>ASCII and even binary data to follow the first batch of binary
>data. I will also be interested in writing the data format, but
>I need to read it, first.
>
>I've seen this handled (rather clumsily IMHO) in Pascal as a
>text file, stepping over EOL characters, etc, manually, stuffing
>the characters into a variant record and pulling a number out.
>I've done it in VS/Pascal using both variant record reads and
>a language extension called a SPACE variable. I've also used
>a straight binary read in Modula-2.

I will assume that you are using Ada 83, although for Ada 95 
the answer is probably the same.

You are probably going to have to do something similar to what
you did in Modula-2. This is the problem with interfacing a 
strongly-typed language to a database designed around a weakly-
typed language. You have to make your code "weakly-typed" until
you can get the data into the proper typed variables.

My suggestion is to make a single package that reads (and writes
if nessecary) this database, and puts everything into the proper
strongly-typed variables for the user. That way the weakly-typed
code and implementation dependancies (if any) are isolated from
the rest of the code.

T.E.D. (strucutred programming bigot)





       reply	other threads:[~1995-04-19  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3mu5mb$ako@twonky.btv.ibm.com>
1995-04-19  0:00 ` Theodore Dennison [this message]
1995-04-19  0:00   ` Heterogeneous file I/O Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox