comp.lang.ada
 help / color / mirror / Atom feed
From: rm@gunlab.com.ru (Roman V. Isaev)
Subject: Re: using charles library
Date: 29 May 2003 10:29:26 -0700
Date: 2003-05-29T17:29:26+00:00	[thread overview]
Message-ID: <d3ba4d4c.0305290929.4ba345cb@posting.google.com> (raw)
In-Reply-To: 3ED2EB15.7B74D21E@somewhere.nil

> > Recently I dug out some old father's Pascal code that does
> > some scientific calculations.
> > It needs user interface and cleanup. Don't want to use Delphi.
> Did you consider a translation of the Pascal code too (it could
> facilitate maintenance and performance, and lift the language
> interfacing issues) ?

    The main question is not the translation itself which is possible. 
It may pose problems too as these 3000+ lines of "pascal" contain mostly this:

	   IF KK=2 THEN GOTO 179;
	   GOTO 178;
    179:   YRR:=YR21;
	   YZR:=ABS((1.0+Y2)/Y12-2.0*XY*(XY-Z)-4.0/3.0*
	   (Y1+Y2)/Y12*Z+(2.0*XY-Z)*(2.0*XY-Z)*(2.0*XY-Z)/3.0*Z*Y1/(1.0+Y));
	   IF YZR>1.E-18 THEN GOTO 190;
	   YZR:=1.E-18;
     190:  YR21:=TAU0*DG*FG/ETA/Q-8.0*Z/YZR;

   But most probably my father won't learn new programming language, he is 
too old. I remember it took a lot of time to switch from Fortran used on 
mainframes and early PCs to Pascal and later he had enough problems simply
switching from turbo6 to delphi.
   Actually this line noise makes sense if you know underlying math. I don't
(and frankly don't want to know). So he have to maintain his code (years 
ago he refused to change his horrid text formatting 'cause it helped him to
remember certain parts of the program when I brougt pascal source formatter).
I can let him sit and pound this program as he did it many times.

> In that case the tool on the link below may help you...
> Gautier  --  http://www.mysunrise.ch/users/gdm/gsoft.htm#p2ada

This tool breaks on lines like this:

	    ZL[IZ+3]:=(DK1[IDK+1]-2.*DK1[IDK+6])*0.001;

2.* is valid, because pascal thinks its just a 2.0*. p2ada also breaks on
things like this:

	     bih:=1.e-5;

there are no useful 1.e constants like 1.e-18 and 1.E6 in ada (and p2ada
can't handle these either, so I gave up for awhile 'cause these are used
a lot). Writeln(FFF,'text',QY1:1:5,'text') turns into something like that:

    Put(FFF);
Put( -- [P2Ada]: !Help! Maybe (file,...) here
"text text text                                 ");
Put( -- [P2Ada]: !Help! Maybe (file,...) here
QY1,5,1,0);
Put( -- [P2Ada]: !Help! Maybe (file,...) here
" text text text"); New_Line; -- [P2Ada]: !Help! Maybe (file)

   Ugh. Dunno how to handle 1.e constants gracefully.



  reply	other threads:[~2003-05-29 17:29 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-26 13:27 using charles library Roman V. Isaev
2003-05-26 13:40 ` Preben Randhol
2003-05-26 16:44   ` Roman V. Isaev
2003-05-26 17:05     ` Preben Randhol
2003-05-26 17:10       ` Preben Randhol
2003-05-26 22:05         ` Roman V. Isaev
2003-05-26 17:16     ` Jeffrey Carter
2003-05-27 15:05       ` Matthew Heaney
2003-05-27 18:28         ` Stephen Leake
2003-05-26 17:20     ` Preben Randhol
2003-05-26 22:46       ` Roman V. Isaev
2003-05-27  4:35         ` Gautier Write-only
2003-05-29 17:29           ` Roman V. Isaev [this message]
2003-05-29 18:56             ` Gautier Write-only
2003-05-29 23:19             ` Gautier Write-only
2003-05-30  7:56               ` Roman V. Isaev
2003-05-30 13:49                 ` Gautier
2003-05-30 14:36               ` Robert C. Leif
2003-05-30 17:32                 ` Preben Randhol
2003-05-30 19:21               ` Randy Brukardt
2003-05-31 11:50                 ` Gautier Write-only
2003-05-31 14:24                   ` Bill Findlay
2003-06-01  3:42                   ` Randy Brukardt
2003-06-02 11:02                   ` Georg Bauhaus
2003-06-02 20:25                     ` Gautier Write-only
2003-05-30  8:48             ` Preben Randhol
2003-05-27 10:31         ` Preben Randhol
2003-05-29 20:30           ` Roman V. Isaev
2003-05-30  9:01             ` Preben Randhol
2003-05-30 22:02               ` Roman V. Isaev
2003-05-31 13:34                 ` Preben Randhol
2003-05-27 18:27     ` Stephen Leake
2003-05-27 20:24 ` Matthew Heaney
replies disabled

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