| | |
[TurboPascal, Dev-Pas, Free-Pascal] problem with longint and unexpected end of file
Thread Solved |
•
•
Join Date: Jul 2009
Posts: 19
Reputation:
Solved Threads: 0
[TurboPascal, Dev-Pas, Free-Pascal] problem with longint and unexpected end of file
0
#1 Aug 3rd, 2009
Hello!
I was looking for the answer here but I couldn't find: http://www.freepascal.org/port.var .
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:
I changes line 52.
I also tried:
But neither of them can help and there's all the time the same error: Got LONGINT expected SMALLINT.
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?
Greetings!
I was looking for the answer here but I couldn't find: http://www.freepascal.org/port.var .
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'.").
Pascal and Delphi Syntax (Toggle Plain Text)
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 look at these two lines:
Pascal and Delphi Syntax (Toggle Plain Text)
308: InitGraph(ster,tryb,path); 52: ster:integer=VGA;
I changes line 52.
Pascal and Delphi Syntax (Toggle Plain Text)
52: ster:smallint=VGA;
Pascal and Delphi Syntax (Toggle Plain Text)
52: ster:shortint=VGA;
And the other thing, that is "unexpected end of file".
End of the file is as follows:
Pascal and Delphi Syntax (Toggle Plain Text)
Resume end end; end .
How to get rid of those two errors?
Greetings!
Re: [TurboPascal, Dev-Pas, Free-Pascal] problem with longint and unexpected end of file
0
#2 Aug 3rd, 2009
•
•
Join Date: Jul 2009
Posts: 19
Reputation:
Solved Threads: 0
Re: [TurboPascal, Dev-Pas, Free-Pascal] problem with longint and unexpected end of file
0
#3 Aug 3rd, 2009
Thanks!
I got rid of the first problem - it was because Dev-Pascal treats integer as longint and shortint as integer.
I removed the spacebar before dot. Now it looks like this
But the error is the same :-(.
Greetings!
I got rid of the first problem - it was because Dev-Pascal treats integer as longint and shortint as integer.
I removed the spacebar before dot. Now it looks like this
Pascal and Delphi Syntax (Toggle Plain Text)
Infos; Resume end end; end.
Greetings!
•
•
Join Date: Jul 2009
Posts: 19
Reputation:
Solved Threads: 0
Re: [TurboPascal, Dev-Pas, Free-Pascal] problem with longint and unexpected end of fi
0
#4 Aug 3rd, 2009
OK, I got rid of those two problems. Now I've got new errors to debug
.
line number 881 contains:
errors:
It looks like I cannot use names (or rather numbers - 200) to indicate something in the code which are then reached by goto or something like this. How to get rid of this error :-)?
I tried to erase that so there was left but it caused other error:
Greetings!
.line number 881 contains:
Pascal and Delphi Syntax (Toggle Plain Text)
200: window(1,1,80,25); ClrScr;
errors:
Pascal and Delphi Syntax (Toggle Plain Text)
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\main.pas trc.pas(1,2) Warning: Unsupported switch $N trc.pas(401,5) Note: Local variable EM1 not used trc.pas(881,1) Error: Identifier not found 200 trc.pas(881,4) Error: Illegal expression trc.pas(881,4) Fatal: Syntax error, ; expected but : found
It looks like I cannot use names (or rather numbers - 200) to indicate something in the code which are then reached by goto or something like this. How to get rid of this error :-)?
I tried to erase that
Pascal and Delphi Syntax (Toggle Plain Text)
200:
Pascal and Delphi Syntax (Toggle Plain Text)
window(1,1,80,25); ClrScr;
Pascal and Delphi Syntax (Toggle Plain Text)
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\main1.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 0200 trc.pas(1749,11) Fatal: Syntax error, identifier expected but LIBRARY found
Greetings!
Last edited by johnyjj2; Aug 3rd, 2009 at 8:41 am. Reason: I got rid of previous errors but there is new one :-)
Re: [TurboPascal, Dev-Pas, Free-Pascal] problem with longint and unexpected end of file
0
#5 Aug 3rd, 2009
•
•
Join Date: Jul 2009
Posts: 19
Reputation:
Solved Threads: 0
Re: [TurboPascal, Dev-Pas, Free-Pascal] problem with longint and unexpected end of file
0
#6 Aug 3rd, 2009
Thanks!
I changed twice in the code 200 into lab200. Now I've got the following errors:
It is weird because in the line 733 I've got now:
Lines 881 & 882 are as follows:
Greetings!
I changed twice in the code 200 into lab200. Now I've got the following errors:
Pascal and Delphi Syntax (Toggle Plain Text)
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\trackal\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
Pascal and Delphi Syntax (Toggle Plain Text)
label lab200;
Pascal and Delphi Syntax (Toggle Plain Text)
window(1,1,80,25); ClrScr; end;
Re: [TurboPascal, Dev-Pas, Free-Pascal] problem with longint and unexpected end of file
0
#7 Aug 3rd, 2009
Whitespace between the keyword end and the period is not significant.
Perhaps you should post more code? It is hard to diagnose what is wrong.
With FPC, you must be sure to have the
I don't think that the $N directive is used in FPC -- the FPC uses native floating-point types -- there is no need to ask for them or emulate them.
Perhaps you should post more code? It is hard to diagnose what is wrong.
With FPC, you must be sure to have the
{$goto on} directive enabled.I don't think that the $N directive is used in FPC -- the FPC uses native floating-point types -- there is no need to ask for them or emulate them.
•
•
Join Date: Jul 2009
Posts: 19
Reputation:
Solved Threads: 0
Re: [TurboPascal, Dev-Pas, Free-Pascal] problem with longint and unexpected end of file
0
#8 Aug 4th, 2009
All results of "200", "label" and "goto":
Without any changes:
After adding to the second line {$GOTO ON}
After changing from
to
compilation errors:
After changing into:
errors:
After changing into
And changing 734:
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!
Pascal and Delphi Syntax (Toggle Plain Text)
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;
Without any changes:
Pascal and Delphi Syntax (Toggle Plain Text)
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\trackal\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 adding to the second line {$GOTO ON}
Pascal and Delphi Syntax (Toggle Plain Text)
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\trackal\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
After changing from
Pascal and Delphi Syntax (Toggle Plain Text)
200: window(1,1,80,25); ClrScr;
Pascal and Delphi Syntax (Toggle Plain Text)
window(1,1,80,25); ClrScr;
Pascal and Delphi Syntax (Toggle Plain Text)
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\trackal\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
After changing into:
Pascal and Delphi Syntax (Toggle Plain Text)
label 200; window(1,1,80,25); ClrScr;
Pascal and Delphi Syntax (Toggle Plain Text)
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\trackal\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
After changing into
Pascal and Delphi Syntax (Toggle Plain Text)
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:
Pascal and Delphi Syntax (Toggle Plain Text)
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\trackal\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
Greetings!
Re: [TurboPascal, Dev-Pas, Free-Pascal] problem with longint and unexpected end of file
0
#9 Aug 4th, 2009
Turbo pascal 7.0.
Labels' identifier can be numbers from 0 to 9999,and any name that can be an identifier...
Free Pascal
A label is a name for a location in the source code to which can be jumped from another location
with a Goto statement. Labels can be digit sequences or identifiers.
The -Sg or -Mtp switches must be specified before labels can be used. By default, Free Pascal doesn’t support label and goto statements. The {$GOTO ON} directive can also be used to allow use of labels and the goto statement.
Link:ftp://ftp.freepascal.org/pub/fpc/docs-pdf/ref.pdf
Labels' identifier can be numbers from 0 to 9999,and any name that can be an identifier...
Free Pascal
A label is a name for a location in the source code to which can be jumped from another location
with a Goto statement. Labels can be digit sequences or identifiers.
The -Sg or -Mtp switches must be specified before labels can be used. By default, Free Pascal doesn’t support label and goto statements. The {$GOTO ON} directive can also be used to allow use of labels and the goto statement.
Link:ftp://ftp.freepascal.org/pub/fpc/docs-pdf/ref.pdf
Be a good part of the community.Don't be ungrateful.
If you ask something on the forum and you got the right answer then mark as solved!
If my opinion helped to you a lot then sometimes give reputation point to me.
I'm just a pascal programmer from Hungary.
Farewell...
If you ask something on the forum and you got the right answer then mark as solved!
If my opinion helped to you a lot then sometimes give reputation point to me.
I'm just a pascal programmer from Hungary.
Farewell...
Re: [TurboPascal, Dev-Pas, Free-Pascal] problem with longint and unexpected end of file
0
#10 Aug 4th, 2009
![]() |
Similar Threads
- Bug in Free Pascal (Pascal and Delphi)
- Record File Problem (Pascal and Delphi)
- Pascal Help (Pascal and Delphi)
- Parse error: syntax error, unexpected $end in (PHP)
- Any help is appreciated (C++)
- no newline at end of file error (C++)
- ERROR--Unexpected end to file (C++)
- C++ complete binary tree using an array. Unexpected end file (C++)
Other Threads in the Pascal and Delphi Forum
- Previous Thread: Balancing chemical equations
- Next Thread: CreateNew affecting all objects
| Thread Tools | Search this Thread |






