Recent

Author Topic: Change old cods from turbo pascal into free pascal  (Read 21029 times)

Nokiarody

  • New Member
  • *
  • Posts: 21
Re: Change old cods from turbo pascal into free pascal
« Reply #30 on: May 24, 2017, 11:20:39 am »
ALSO PHOTO

Nokiarody

  • New Member
  • *
  • Posts: 21
Re: Change old cods from turbo pascal into free pascal
« Reply #31 on: May 24, 2017, 11:21:10 am »
ALSO

Nokiarody

  • New Member
  • *
  • Posts: 21
Re: Change old cods from turbo pascal into free pascal
« Reply #32 on: May 24, 2017, 11:22:21 am »
also

RAW

  • Hero Member
  • *****
  • Posts: 868
Re: Change old cods from turbo pascal into free pascal
« Reply #33 on: May 24, 2017, 06:06:47 pm »
Try this:
1.) Download LAZARUS IDE and install it...
2.) Open every Unit (*.pas) and add {$MODE TP} after every UnitName.
3.) Choose Compiler options and compile...

EXAMPLE: TurboPascal 7 BreakOut Example:
Code: Pascal  [Select][+][-]
  1. {************************************************}
  2. {                                                }
  3. {   Breakout Demo Program                        }
  4. {   Copyright (c) 1992 by Borland International  }
  5. {                                                }
  6. {************************************************}
  7.  
  8. program Breakout;
  9. {$MODE TP}
  10. {
  11.  
  12.   This is a version of the classic arcade game, Breakout.
  13.  
  14.     SCREEN.PAS
  15.     COUNT.PAS
  16.     BRICKS.PAS
  17.     BOUNDS.PAS
  18.     WALLS.PAS
  19.     BREAKOUT.PAS
  20.  
  21.   To build an executable file, compile from the command line with:
  22.  
  23.     tpc /m breakout
  24.  
  25.   or load BREAKOUT.PAS into the integrated development
  26.   environment and press F9.
  27.  
  28.   When testing the program, you may want to force the paddle to
  29.   follow the ball, so you'll never miss. The program contains
  30.   conditional compilation directives to produce this version, and
  31.   you can build it from the command line with:
  32.  
  33.     tpc /DTest breakout
  34.  
  35.   or load BREAKOUT.PAS into the integrated development
  36.   environment, select Alt-O/C/Alt-C, type 'Test' (without the quotes,
  37.   of course) followed by the Enter key, then select Alt-C/B to
  38.   rebuild the executable file.
  39. }
  40.  
  41. uses Screen, Count, Bricks, Bounds, Walls, Crt, Dos;
  42.  
  43. var
  44.   ss        : SaveScreen;
  45.   w         : Wall;
  46.   b         : Ball;
  47.   p         : Paddle;
  48.   Speed     : LimitCounter;
  49.   Left      : LeftBound;
  50.   Top       : UpperBound;
  51.   Right     : RightBound;
  52.   Bottom    : LowerBound;
  53.   Obstacles : ObstacleList;
  54.   PaddleMsg,
  55.   SpeedMsg,
  56.   StartMsg,
  57.   QuitMsg,
  58.   PauseMsg1,
  59.   PauseMsg2,
  60.   TypeMsg   : TextString;
  61.   Score     : Counter;
  62.   Highest   : Counter;
  63.   Balls     : DownCounter;
  64.   X         : Integer;
  65.   Finished  : Boolean;
  66.   FirstGame : Boolean;
  67.   TypeInc,
  68.   ch        : Char;
  69.  

It compiles fine, but I don't like to install DOSBox, because everytime when I start DOSBox my monitor does a weird sound...
Windows 7 Pro (x64 Sp1) & Windows XP Pro (x86 Sp3).

Nitorami

  • Sr. Member
  • ****
  • Posts: 496
Re: Change old cods from turbo pascal into free pascal
« Reply #34 on: May 25, 2017, 09:33:48 am »
RAW
At Nokiarody's level of understanding, I would not confuse him with Lazarus, it is far too complicated  >:D. Let him go on with the text mode IDE.

Nokiarody
I really do not know what you are doing. You say you installed Lazarus but your pictures show the text mode IDE, not Lazarus. You can work with the text mode IDE of course, it is very similar to Turbo Pascal, but this is not Lazarus.

Where did you get program Project1 from ? This is a Lazarus example, not your old code. And you are trying to run the example in the text mode IDE.

Do not call programs "24,5", give them a proper name with a .pas ending.

And yes, as RAW said, the {$mode} switch sets the compatibility, and you should set it to {$mode tp} for turbo pascal compatibility in all of your units.


Nokiarody

  • New Member
  • *
  • Posts: 21
Re: Change old cods from turbo pascal into free pascal
« Reply #35 on: May 25, 2017, 10:22:57 pm »
THANK you  Raw and Nitorami
that is my mistake
i could not the  the photo upload
i will try again
and show maybe tomorrow
 

Nokiarody

  • New Member
  • *
  • Posts: 21
Re: Change old cods from turbo pascal into free pascal
« Reply #36 on: May 26, 2017, 07:23:32 am »
hi every one
here the photos from lazarus

Nokiarody

  • New Member
  • *
  • Posts: 21
Re: Change old cods from turbo pascal into free pascal
« Reply #37 on: May 26, 2017, 07:27:35 am »
anther photo

Nitorami

  • Sr. Member
  • ****
  • Posts: 496
Re: Change old cods from turbo pascal into free pascal
« Reply #38 on: May 28, 2017, 01:05:19 pm »
You created an empty console application. To execute some code, put it into TApplication.Run !

Nokiarody

  • New Member
  • *
  • Posts: 21
Re: Change old cods from turbo pascal into free pascal
« Reply #39 on: May 29, 2017, 03:05:49 pm »
 I have added parts of the code
But the black box comes out
1-Do I have to add all the parts together or not
2-The way to arrange operations (Procedures and functions) leave it as it is or should I do something to connect one to others
3-some of Procedures reacts on other way will add the  photo
Project my application has raised Exception Class External SIGSEGV
4-that is right I choosed console application
Or  I have to choose another option
Easy program
Application

Nokiarody

  • New Member
  • *
  • Posts: 21
Re: Change old cods from turbo pascal into free pascal
« Reply #40 on: May 29, 2017, 03:12:26 pm »
the Photo

Nokiarody

  • New Member
  • *
  • Posts: 21
Re: Change old cods from turbo pascal into free pascal
« Reply #41 on: May 29, 2017, 03:14:26 pm »
photo

Nokiarody

  • New Member
  • *
  • Posts: 21
Re: Change old cods from turbo pascal into free pascal
« Reply #42 on: May 29, 2017, 03:29:14 pm »
I am sorry for the qualitet of the photo
here they allow just 250 kb
Allowed file types: bmp, doc, gif, jpg, mpg, pdf, png, txt, zip, rar, tar, gz, tgz, 7z, patch, diff, ico
 Restrictions: 4 per post, maximum total size 250KB, maximum individual size 250KB

 

TinyPortal © 2005-2018