From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,74d953d10520ed5e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-29 10:29:26 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: rm@gunlab.com.ru (Roman V. Isaev) Newsgroups: comp.lang.ada Subject: Re: using charles library Date: 29 May 2003 10:29:26 -0700 Organization: http://groups.google.com/ Message-ID: References: <3ED2EB15.7B74D21E@somewhere.nil> NNTP-Posting-Host: 195.151.20.194 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1054229366 23713 127.0.0.1 (29 May 2003 17:29:26 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 29 May 2003 17:29:26 GMT Xref: archiver1.google.com comp.lang.ada:38007 Date: 2003-05-29T17:29:26+00:00 List-Id: > > 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.