Hello!
I was looking for the answer here but I couldn't find: h ttp://w ww.freepascal.org/port.var -> Free Pascal - Porting Turbo Pascal Applications.
I've got old code in Turbo Pascal and I try to run it on Dev-Pascal 1.9.2. (I also tried Lazarus application, but there was "Error. Project raised exception class 'External: SIGSEGV'.").
I look at these two lines:Code:Free Pascal Compiler version 1.0.6 [2002/04/23] for i386 Copyright (c) 1993-2002 by Florian Klaempfl Target OS: Win32 for i386 Compiling f:\intern\26turb~1\program\main1.pas main1.pas(1,2) Warning: Unsupported switch $N Compiling main2.pas main2.pas(1,2) Warning: Unsupported switch $N main2.pas(308,15) Error: call by var parameters have to match exactly: Got LONGINT expected SMALLINT main2.pas(645,76) Warning: Comment level 2 found main2.pas(843,3) Warning: Comment level 2 found main2.pas(643,2) Fatal: Unexpected end of file
I changes line 52.Code:308: InitGraph(ster,tryb,path); 52: ster:integer=VGA;
I also tried:Code:52: ster:smallint=VGA;
But neither of them can help and there's all the time the same error: Got LONGINT expected SMALLINT.Code:52: ster:shortint=VGA;
And the other thing, that is "unexpected end of file".
End of the file is as follows:
How to get rid of those two errors?Code:Resume end end; end .
Greetings!
end of file shall be End. I don't know if you can have that space there.
otherwise, you often miss an End for something else, so the End. comes too early.
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall
Thanks!
I corrected this error and now I've got other problem. There were some labels which names begin with digit so I changes label 200 into label lab200.
Now I've got the following errors:
It is weird because in the line 733 I've got now:Code:Free Pascal Compiler version 1.0.6 [2002/04/23] for i386 Copyright (c) 1993-2002 by Florian Klaempfl Target OS: Win32 for i386 Compiling f:\dev-pas\program\trc.pas trc.pas(1,2) Warning: Unsupported switch $N trc.pas(401,5) Note: Local variable EM1 not used trc.pas(882,1) Error: Label used but not defined LAB200 trc.pas(1749,11) Fatal: Syntax error, identifier expected but LIBRARY found
Lines 881 & 882 are as follows:Code:label lab200;
About the last one error:Code:window(1,1,80,25); ClrScr; end;
Line 1749 contains:
Greetings!Code:procedure library;
Last edited by johnyjj2; 08-07-2009 at 01:55 AM. Reason: +1749
Labels have to be defined in the form as well as the code, or else they have to be in the var list and created dynamically.
All results of "200", "label" and "goto":
Without any changes:Code:69: menu1[4]:='Library '; 732: procedure axesimu; 733: label 0200; 744: case vv of 747: 3: Goto 0200; 881: 200: window(1,1,80,25); ClrScr; 884: procedure TwoAxles; 885:label 100; 1025: if (zn='N') or (zn='n') then goto 100; 1752: procedure library; 1871: 4: library;
After adding to the second line {$GOTO ON}Code:Free Pascal Compiler version 1.0.6 [2002/04/23] for i386 Copyright (c) 1993-2002 by Florian Klaempfl Target OS: Win32 for i386 Compiling f:\dev-pas\program\02trc~1.pas 02trc~1.pas(1,2) Warning: Unsupported switch $N 02trc~1.pas(401,5) Note: Local variable EM1 not used 02trc~1.pas(881,1) Error: Identifier not found 200 02trc~1.pas(881,4) Error: Illegal expression 02trc~1.pas(881,4) Fatal: Syntax error, ; expected but : found
After changing fromCode:Free Pascal Compiler version 1.0.6 [2002/04/23] for i386 Copyright (c) 1993-2002 by Florian Klaempfl Target OS: Win32 for i386 Compiling f:\dev-pas\program\02trc~1.pas 02trc~1.pas(1,2) Warning: Unsupported switch $N 02trc~1.pas(402,5) Note: Local variable EM1 not used 02trc~1.pas(882,1) Error: Identifier not found 200 02trc~1.pas(882,4) Error: Illegal expression 02trc~1.pas(882,4) Fatal: Syntax error, ; expected but : found
toCode:200: window(1,1,80,25); ClrScr;
compilation errors:Code:window(1,1,80,25); ClrScr;
After changing into:Code:Free Pascal Compiler version 1.0.6 [2002/04/23] for i386 Copyright (c) 1993-2002 by Florian Klaempfl Target OS: Win32 for i386 Compiling f:\dev-pas\program\02trc~1.pas 02trc~1.pas(1,2) Warning: Unsupported switch $N 02trc~1.pas(402,5) Note: Local variable EM1 not used 02trc~1.pas(883,1) Error: Label used but not defined 0200 02trc~1.pas(1750,11) Fatal: Syntax error, identifier expected but LIBRARY found
errors:Code:label 200; window(1,1,80,25); ClrScr;
After changing intoCode:Free Pascal Compiler version 1.0.6 [2002/04/23] for i386 Copyright (c) 1993-2002 by Florian Klaempfl Target OS: Win32 for i386 Compiling f:\dev-pas\program\02trc~1.pas 02trc~1.pas(1,2) Warning: Unsupported switch $N 02trc~1.pas(402,5) Note: Local variable EM1 not used 02trc~1.pas(882,8) Error: Illegal expression 02trc~1.pas(882,8) Error: Illegal expression 02trc~1.pas(882,8) Fatal: Syntax error, ; expected but ordinal const found
And changing 734:Code:window(1,1,80,25); ClrScr;
label 0200;
into
label lab200;
And 748:
3: Goto 0200;
into
3: Goto lab200;
And 886:
label 100;
into
label lab100;
And 1026:
if (zn='N') or (zn='n') then goto 100;
into
if (zn='N') or (zn='n') then goto lab100;
And 1069
100: ClrScr;
into
label lab100; ClrScr;
The errors:
Greetings!Code:Free Pascal Compiler version 1.0.6 [2002/04/23] for i386 Copyright (c) 1993-2002 by Florian Klaempfl Target OS: Win32 for i386 Compiling f:\dev-pas\program\02trc~1.pas 02trc~1.pas(1,2) Warning: Unsupported switch $N 02trc~1.pas(402,5) Note: Local variable EM1 not used 02trc~1.pas(883,1) Error: Label used but not defined LAB200 02trc~1.pas(1069,7) Error: Illegal expression 02trc~1.pas(1069,7) Error: Illegal expression 02trc~1.pas(1069,7) Fatal: Syntax error, ; expected but identifier LAB100 found
Last edited by johnyjj2; 08-07-2009 at 01:54 AM.
Oh. Goto is evil. Don't use it. You should be using while loops, etc here.
I think the problem really comes down the a problem with poor programming. Function calls, loops, etc are the way to handle the types of things you're doing. There may be compatibility directives you can pass to the compilers to get them to act like TP5.5, but my sense is the code is in desperate need of review/reworking.
Thanks for your reply. It is not my code but something what was written in 1991 and now I was asked to recompile it in XP and later change interface. At this moment I am in that first stage i.e. I cannot compile it. This program contains about 3000 of lines in two PAS files and performs some sophisticated maths calculations so I'd like to make as little changes as possible. On the other hand it wasn't my code and I know nothing about the aim of this program - I can see how it works and what it is for after recompiling it
.
Greetings!
You can probably still find TurboPascal 5.5 for free, and get it running under DOSBox. My guess, though, is that you need to look at your compiler options for the three compilers you're trying.
Thanks!
I downloaded and installed DOSBox & Turbo Pascal 7.0 on it. I tried to compile my program on TP7.0 but there is weird problem. I open trc.pas, press F9 (Make) and see "Error 15: File not found (CDF.TPU)" in the window "\PROG\TRC.PAS". I check and there exists file CDF.TPU in the directory C:\dosprog\prog where on DOSBox I emulate disc C by command "mount c c:\dosprog\".
Greetings!
Last edited by johnyjj2; 08-07-2009 at 06:38 AM.
Within TP7 under DOSBox, can you open the file where it expects to find it?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks