Recent

Author Topic: Hints about fpc.cfg and debugger that does not stop  (Read 4098 times)

JamesGibbens

  • Newbie
  • Posts: 4
Hints about fpc.cfg and debugger that does not stop
« on: September 23, 2018, 09:49:19 pm »
Many years ago I did some simple programming with Turbo Pascal on a Windows XP computer. Now after many years I want to start again. So I downloaded Lazarus 1.0.8  and FPC 3.0.4 onto my old Toshiba laptop using Fedora27.
I entered the first program. compiled it and received th following message on the Source Editor window :
Compile project, Target:MyNewFirst : Success  2 Hints
Hint: Start of reading config file /etc/fpc.cfg
Hint: End of reading config file /etc/fpc.cfg

So I told it to RUN, but nothing happened. After some time I started punching some keys, but still nothing happened. I told the computer to Compile and received this message: Stop current debugging and rebuild project?
I typed yes and received :"Execution stopped" as reply.

This is as far as I got.
 The file fpc.cfg is in the directory /etc. I opened it with LibreOffice Writer but could not see anything I suspected as untoward. I also could not change anyting in the file.

Now will you please help: what is wrong, where did I fall off the bus and how can I fix it? Please use very simple easy clear instructions as I am very newbie on this. What Linux product is there to compare with Notepad or Wordpad? 

If nothing ccan be fixed, how do I erase Lazarus and FPC so that NOTHING of them is left? Can I theb install them again?

Thank you for your patience and replies.
James Gibbens

Gammatester

  • Jr. Member
  • **
  • Posts: 69
Re: Hints about fpc.cfg and debugger that does not stop
« Reply #1 on: September 23, 2018, 10:47:40 pm »
Without more information, I guess that you have an old Pascal program, which outputs to the console. Do you have told Lazarus to build a console applicaation?

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Hints about fpc.cfg and debugger that does not stop
« Reply #2 on: September 24, 2018, 01:18:44 am »
Stupid question, but maybe ... Did you tell Lazarus to open a console for your program? It is in the main menu:
  "View" > "Debug Windows" > "Terminal Output"
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: Hints about fpc.cfg and debugger that does not stop
« Reply #3 on: September 24, 2018, 05:19:19 am »
Yes, but additionally:
Old tp programs under Windows need to have {$apptype console} added on top of the program file,like so:
Code: Pascal  [Select][+][-]
  1. program myoldtpcode;
  2. {$apptype console}
  3. begin
  4. end.
Otherwise the console code is not set up.
This has been introduced in Delphi 1 and is not Freepascal specific.

Note that you may have to use {$mode TP} too.
« Last Edit: September 24, 2018, 05:41:58 am by Thaddy »
Specialize a type, not a var.

JamesGibbens

  • Newbie
  • Posts: 4
Re: Hints about fpc.cfg and debugger that does not stop
« Reply #4 on: September 25, 2018, 01:41:48 pm »
Good afternoon Gentlemen,
Please pardon my prolonged silence - I tried my best to test and understand your advice. If what follows is too "chatty", please scold me.
Remember when radio buttons were those buttons on the radio in Dad's motor car? You pushed them to select other stations or wavelengths. No?, that shows how old I am.

Gammatester, correct. I did not set up a console application because I stopped using Pascal when OOP started to became important. I did not even think about OOP. More a little later.
lucarnar, (am I correct?), thanks for the View.  Debug.Terminal Output. It did not work at the start, but I tried a new progam containing all those thingamabobs in curly brackets {$mode objfpc}  {H+}, etc. Then it did work. Now Gammatester and lucarnar how do I obtain a fulscreen console when I run my program? I also started a new project and received MyApplication from TMyApplication. and entered some code after the note {add your program here}  in TMyApplication>DoRun. Is this correct?  Where can I find  more help and information on this?
Thaddy, thanks. The compiler did not want to know anything about {$apptype console} - it is not supported by the target OS (Fedora27 - is that what it meant?)

Thanks again gentlemen for your answers and advice. Please point me in the right direction. I will try my best.

Thank you.
James Gibbens

Gammatester

  • Jr. Member
  • **
  • Posts: 69
Re: Hints about fpc.cfg and debugger that does not stop
« Reply #5 on: September 25, 2018, 04:21:35 pm »
Now Gammatester and lucarnar how do I obtain a fulscreen console when I run my program?
I think this is not possible under newer OS. With WIndows 98 I can simply press Alt+Enter, this does not work with Windows 7+ or Raspian, where you can only maximize the GUI console window. I do not have Fedora, but I guess it behaves similar.

JamesGibbens

  • Newbie
  • Posts: 4
Re: Hints about fpc.cfg and debugger that does not stop
« Reply #6 on: September 25, 2018, 04:38:29 pm »
Thank you. Do I then have to write a "window" program so that output is placed there? Where can I find an example of the code?
Thank you.

Gammatester

  • Jr. Member
  • **
  • Posts: 69
Re: Hints about fpc.cfg and debugger that does not stop
« Reply #7 on: September 25, 2018, 05:37:37 pm »
Here is an example. Save the following ocde
Code: Pascal  [Select][+][-]
  1. program Hello;
  2.  
  3. uses
  4.   crt;
  5.  
  6. begin
  7.   writeln('Hello world');
  8.   write('Press enter to continue');
  9.   readln;
  10. end.
  11.  
as hello.pas. If you use Free Pascal just compile it with fpc hello.pas, then run the executable. With Lazarus, open the file hello.pas with File/Open. Lazarus recognizes a complete program and asked what  kind of project you want. Choose 'Console application'. When you see the code in the editor press the run button or hit F9. The program will be compiled, a new window will be created and the two text lines are displayed (You can press the window border maximizze buttion, or change the layout of the window or the properties of the window or terminal under *nix). Hit enter to close. That's all.
« Last Edit: September 25, 2018, 05:39:24 pm by Gammatester »

JamesGibbens

  • Newbie
  • Posts: 4
Re: Hints about fpc.cfg and debugger that does not stop
« Reply #8 on: September 25, 2018, 08:14:45 pm »
Thank you very much. I certainly will try it.

 

TinyPortal © 2005-2018