Recent

Author Topic: How to compile *.pas with text-graphic  (Read 8301 times)

molly

  • Hero Member
  • *****
  • Posts: 2345
Re: How to compile *.pas with text-graphic
« Reply #15 on: April 23, 2016, 11:17:25 am »
First code-example worked for me (if the attached picture is the result what you had in mind)

As already suggested, it is probably a code-page related issue.

TJF

  • New Member
  • *
  • Posts: 12
Re: How to compile *.pas with text-graphic
« Reply #16 on: April 23, 2016, 11:21:33 am »
if the attached picture is the result what you had in mind


Yes!

wp

  • Hero Member
  • *****
  • Posts: 6301
Re: How to compile *.pas with text-graphic
« Reply #17 on: April 23, 2016, 11:24:18 am »
Tested with Laz-trunk/fpc3.0. Had to remove the unit ls1000 and replace the call to "charinput" by "readln". Then the program compiles fine and displays the screenshot of yout attachment - no other changes required, no crash!

In the Lazarus IDE, however, the line characters are not displayed correctly. To show them right-click in the editor window containing "test2.pas", select "FileSettings" / "Encoding" / "CP437", then "Reopen with another encoding", and here we are - see screenshot.
« Last Edit: April 23, 2016, 11:35:27 am by wp »
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

molly

  • Hero Member
  • *****
  • Posts: 2345
Re: How to compile *.pas with text-graphic
« Reply #18 on: April 23, 2016, 11:34:54 am »
Same here wp :-)

@TJF:
In case you have a unicode console, read the manual on how to do/setup proper encoding to match your example (some terminal programs simply refuses because they lack proper encoding(-settings)).

If using a 'normal' console, make sure the code-page matches 437 _and_ that your console is using a font that has such characters to display (my console is using courier new)

TJF

  • New Member
  • *
  • Posts: 12
Re: How to compile *.pas with text-graphic
« Reply #19 on: April 23, 2016, 11:56:23 am »
Thank you very much!

Could you please tell me, what your (Compile->)Target is (go32v2)? And where I can change the console? I am not shure, if I am on the wrong way here ...

Or do you recommend to use Lazarus?

molly

  • Hero Member
  • *****
  • Posts: 2345
Re: How to compile *.pas with text-graphic
« Reply #20 on: April 23, 2016, 12:02:02 pm »
I am using my favourite text-editor (just take a pick, any will do), and compile with the FPC command-line compiler with target being win32.

If you are on windows, then you can change the font of the console by going to the system menu of the console (that icon on the top-left), and press properties. There are some tabs, and in one of them you can change the font. I'm not into betting games, but i guess yours is set to lucida console ;-)

You can also use lazarus, and should be no problem. Just use whatever works best for you.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7493
Re: How to compile *.pas with text-graphic
« Reply #21 on: April 23, 2016, 12:10:32 pm »
I ran your .pas directly in the release (fpc 3.0) Win32 textmode IDE on win10/64 and when ran it showed up fine. Both when run from the IDE as from the console

I used the win32 compiler, since it is a 64-bit windows system so DOS .exe's won't run. I did not change codepage with chcp, and the codepage already was 850. I probably didn't change many textmode properties except copy and paste and size related.

The image is the same as Molly's above, though with different fonts.

As for textmode IDE vs Lazarus, the compiler is the same. It is only editor and GUI preferences that set them apart.   I generally use Lazarus now, having gotten used to Delphi at work,  but have mostly used FP till 2008-2010. I still do sometimes, including remote putty sessions (e.g. to RPI)
« Last Edit: April 23, 2016, 02:06:59 pm by marcov »

wp

  • Hero Member
  • *****
  • Posts: 6301
Re: How to compile *.pas with text-graphic
« Reply #22 on: April 23, 2016, 12:29:58 pm »
Could you please tell me, what your (Compile->)Target is (go32v2)?
I was using Lazarus in my test, at first Laz trunk, later Laz 1.2.6. Compile target was "default" in each case.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

TJF

  • New Member
  • *
  • Posts: 12
Re: How to compile *.pas with text-graphic
« Reply #23 on: April 23, 2016, 12:33:42 pm »
Ok. Thank you very much!

My favorite Editor would be Notepad++ in this case. I could find the way to show the right signs: OEM-US (s. attachment).

If I do (Notepad++):
C:\FPC\3.0.0\bin\i386-win32\fpc.exe "$(FULL_CURRENT_PATH)"
... and get my old problem. But with your infos I will find the way ...

My console has "Consolas" and it shows Codepage 850 ...

molly

  • Hero Member
  • *****
  • Posts: 2345
Re: How to compile *.pas with text-graphic
« Reply #24 on: April 23, 2016, 12:48:34 pm »
Just to make sure (as it isn't that trivial on windows), here you can see how to add/change console fonts.

Here is a related question on superuser, with also a link to console2 (that you saw in my picture) as it saves your from dumbwitted registry peeking n' poking. m$ couldn't make it any more user-friendly  >:D

TJF

  • New Member
  • *
  • Posts: 12
Re: How to compile *.pas with text-graphic
« Reply #25 on: April 23, 2016, 01:09:34 pm »
I will try ...  :)