ASCII 219 not print correctly lazarus / 21-General ---------------------------------------------------------------------- freedom71 · 2021-02-09 08:57 good morning  I have a problem on FC version Fp 1.0.12 32bit on Windows 10 64. code: ____________________________________________________________ uses crt;  begin  textcolor(10); write('████') (* this is ASCII GRAPHIC NUMBER 219*); readln; end. _____________________________________________________________ When RUN the result is: ÛÛÛÛÛ Could you please help me, I am not an experienced programmer. Thank you very much! ---------------------------------------------------------------------- Bart · 2021-02-09 09:02 The FP IDE uses a different codepage then your console application. Try changing the codepage to 437 before running the application. Code: [Select]C:\Path\To\Application>chcp 437 Bart ---------------------------------------------------------------------- freedom71 · 2021-02-09 11:16 Sorry I am not very experienced could you give me an example please? Thank you very much! ---------------------------------------------------------------------- Bart · 2021-02-09 11:55 Quote from: freedom71 on February 09, 2021, 12:16:11 pmSorry I am not very experienced could you give me an example please? I gave you the example. I can elaborate a bit more on that: Assuming the executable is in c:\myprograms\myproject\test.exe then Windows Start Menu->cmd.exe This will start a command prompt. Code: [Select]C:\Users\UsreName>cd c:\myprograms\myproject chcp 437 test This will change the current codepage of the console to 437 and then start the test.exe (your test application). Bart ---------------------------------------------------------------------- MarkMLl · 2021-02-09 12:34 Quote from: freedom71 on February 09, 2021, 12:16:11 pmSorry I am not very experienced could you give me an example please? Bit of detail to explain what's actually going on (I'm waiting for somebody to call me back). ASCII is a 7-bit character set with the bottom 32 characters reserved for control purposes, so only $20..$7f (0x20..0x7f, with the last character in that range sometimes handled specially) is valid ASCII. Characters in that range have agreed values, but your Char(219) is outside it so isn't ASCII. There are many non-ASCII ("national") character sets which accommodate variation in the 0x20-0x7f range, and also extend it as an 8-bit character set up to 0xff. These are generally referred to as code pages. In addition, there's Unicode which overlaps with ASCII for the bottom 7-bit set, but then does its own thing from 0x80 upwards. However you don't generally get codepages in the Unicode context, since each character has its own unique codepoint. You're likely to see mention of UTF-8, which is one particular way of storing Unicode characters. HTH. MarkMLl ---------------------------------------------------------------------- freedom71 · 2021-02-09 13:02 I tried typing chcp 437 the console activated 437 correctly but output does not work.     Thanks!!! ---------------------------------------------------------------------- Bart · 2021-02-09 13:19 You can try the following at th ebeginnin gof your program: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   SetUseACP(False); I don't know if that procedure (of unit crt) is available in current fpc 3.2.0 though (it is in fpc trunk). Also make sure that the character you print actually has the "ASCII value" (as explained above, it is not ASCII) of 219. Bart ---------------------------------------------------------------------- freedom71 · 2021-02-09 14:06 WOOOOOOOOOOOOOOOOWWWWWWWW!!!! IT WORKS!!!!! CAN I KNOW more about this command? I just need a link THANK YOU!!!!!! ---------------------------------------------------------------------- MarkMLl · 2021-02-09 14:28 Quote from: freedom71 on February 09, 2021, 03:06:10 pmI just need a link Easy hit on Google http://free-pascal-general.1045716.n5.nabble.com/CRT-unit-and- bug-32558-td5736301.html https://forum.lazarus.freepascal.org/index.php?topic=47401.15 MarkMLl ---------------------------------------------------------------------- freedom71 · 2021-02-09 14:36 GREAT!!! One last question.... Do you recommend me to continue FreePascal or Lazarus? I am new to Pascal and would like to get off to a good start!!! THANK YOU FOR YOUR AVAILABILITY!!! thanks to all the staff!!! ---------------------------------------------------------------------- MarkMLl · 2021-02-09 16:18 Quote from: freedom71 on February 09, 2021, 03:36:47 pmDo you recommend me to continue FreePascal or Lazarus? Lazarus is a development environment which uses the Free Pascal Compiler (FPC) for code generation. If you want to generate GUI programs you almost certainly want Lazarus plus its associated class library rather than a simpler text editor etc., if you don't want to generate GUI programs then you might find that the fp editor that comes with the compiler is adequate. MarkMLl ---------------------------------------------------------------------- Bart · 2021-02-09 21:34 FYI: You can also use Lazarus (the IDE) to create console programs. You get the benefits of Lazarus's codetools for free then... Bart ---------------------------------------------------------------------- MarkMLl · 2021-02-09 21:57 I very carefully didn't say that Lazarus couldn't be used for console programs, only that if one wanted to work on GUI programs it was virtually indispensable. Obviously Lazarus has some real advantages (e.g. the quality of the debugger integration) irrespective of target. MarkMLl