Lazarus
Free Pascal => Windows => Topic started by: even 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 ...
-
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.
-
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. :'(
-
I found that someone on the Internet had the same problem, but there was no solution.
-
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.
-
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
-
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!
-
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
-
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.
-
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).
-
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!
-
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 :)