Recent

Author Topic: Strange problem with FPC 3.0.2  (Read 9967 times)

even

  • Newbie
  • Posts: 4
Strange problem with FPC 3.0.2
« on: April 03, 2017, 03:43:47 am »
I installed the 3.0.2 version of the free pascal compiler on my desktop(Windows 10-x64), there was a very strange question: when testing the console program, I entered a number in the console and press Enter, the cursor jumped back to the beginning of the line and didn't wrap to the next line, Ctrl+C break function didn't work too. please help ...

Thaddy

  • Hero Member
  • *****
  • Posts: 14197
  • Probably until I exterminate Putin.
Re: Strange problem with FPC 3.0.2
« Reply #1 on: April 03, 2017, 06:51:54 am »
I just tested the 3.0.2 fp.exe from the official distribution on windows 10.1 64 and it works fine. That version is a 32 bit executable one of course.
To stop the ide you do not use ctrl-c but alt-x by the way. ctrl-c is intentionally intercepted.
Specialize a type, not a var.

even

  • Newbie
  • Posts: 4
Re: Strange problem with FPC 3.0.2
« Reply #2 on: April 03, 2017, 07:30:04 am »
Thanks, I also tested version 3.0.0 and had the same results on my desktop, It seems "Enter" didn't wrap to new line in console program and Ctrl-C resulted "^C". But it does work fine on my laptop which is also window 10 x64.  :'(

even

  • Newbie
  • Posts: 4
Re: Strange problem with FPC 3.0.2
« Reply #3 on: April 03, 2017, 08:58:51 am »
I found that someone on the Internet had the same problem, but there was no solution.

Thaddy

  • Hero Member
  • *****
  • Posts: 14197
  • Probably until I exterminate Putin.
Re: Strange problem with FPC 3.0.2
« Reply #4 on: April 03, 2017, 10:22:59 am »
I also built a 64 bit version. Same thing: everything works as expected on windows 10.1 64 bit.
Try re-downloading and re-installing FPC and use only an official installer from here http://www.freepascal.org/download.var

If you found something on the internet and it is NOT on this forum, plz provide a link: there's lots of bogus info around and you will find many experts - if not all - only here.
Specialize a type, not a var.

even

  • Newbie
  • Posts: 4
Re: Strange problem with FPC 3.0.2
« Reply #5 on: April 04, 2017, 08:46:28 am »
I tried all the installation again according to your suggestions, unfortunately didn't work it out. Free pascal works fine except the Enter-wrap problem while debuging console program. Is it possible windows configuration caused this?
The following is the same problem searched from web, sorry for the language
http://www.imooc.com/wap/wenda/id/335248

enzo740

  • Newbie
  • Posts: 3
Re: Strange problem with FPC 3.0.2
« Reply #6 on: August 29, 2017, 08:19:00 am »
Hello!
I also have windows 10-x64 and the same thing happened to me. When I used the 'Run' option or when using the 'Debugger' with the 'Step Over' (F8), the console appeared, and when I had to type some number or character and pressed enter, the cursor was down and I received erroneous results.
What I did to fix it was, add the 'Clrscr' command, which cleans the console.
I am going  to attach the command line and how the console would look.
Hope it works for you, regards!
Informatics Engineering Student - from Argentina

dsp2009

  • Newbie
  • Posts: 1
Re: Strange problem with FPC 3.0.2
« Reply #7 on: January 07, 2018, 07:53:03 pm »
thank you, enzo740! Your solution is works fine! The main thing is "uses crt" clause, in my case "clrscr" itself is not nesessary. I use "uses crt" in my program and this fixed the problem

turrican

  • Full Member
  • ***
  • Posts: 133
  • Pascal is my life.
    • Homepage
Re: Strange problem with FPC 3.0.2
« Reply #8 on: January 10, 2018, 12:29:52 pm »
Hello!
I also have windows 10-x64 and the same thing happened to me. When I used the 'Run' option or when using the 'Debugger' with the 'Step Over' (F8), the console appeared, and when I had to type some number or character and pressed enter, the cursor was down and I received erroneous results.
What I did to fix it was, add the 'Clrscr' command, which cleans the console.
I am going  to attach the command line and how the console would look.
Hope it works for you, regards!

Why are you using Write and not Writeln? i'm curious.

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Strange problem with FPC 3.0.2
« Reply #9 on: January 10, 2018, 12:33:01 pm »
Why are you using Write and not Writeln? i'm curious.
To have the cursor wait for input directly after the colon ? (with a writeln it would appear on the next line).

enzo740

  • Newbie
  • Posts: 3
Re: Strange problem with FPC 3.0.2
« Reply #10 on: January 15, 2018, 09:11:37 am »
thank you, enzo740! Your solution is works fine! The main thing is "uses crt" clause, in my case "clrscr" itself is not nesessary. I use "uses crt" in my program and this fixed the problem
ohh, great! you're welcome!  :D
Edit: I tried what you mentioned and it's true! It is not necessary to use the 'ClrScr'. Only with the 'Uses CRT' works! Thanks!
« Last Edit: January 15, 2018, 09:39:53 am by enzo740 »
Informatics Engineering Student - from Argentina

enzo740

  • Newbie
  • Posts: 3
Re: Strange problem with FPC 3.0.2
« Reply #11 on: January 15, 2018, 09:23:35 am »
Why are you using Write and not Writeln? i'm curious.
To have the cursor wait for input directly after the colon ? (with a writeln it would appear on the next line).
In effect, it is to keep the cursor on the same line. In general I use 'writeln', but if after a text there is an input, I use 'write'. It's purely aesthetic, my programming teacher taught it to me  :)
Informatics Engineering Student - from Argentina

 

TinyPortal © 2005-2018