GBP (£) in Simple Command Line Programs lazarus / 61-Beginners ---------------------------------------------------------------------- DavidDMuir · 2015-08-10 17:13 Hope this isn't a stupid question... I am thinking about teaching school pupils to use Free Pascal with Lazarus and would like to start with simple command line programs rather than jumping straight into forms and buttons etc. Worked out I had to add a readln at the end of the programs to stop the output window disappearing before you could read it. I would like to display characters such as the GBP (i.e. £ sign) in the output window but I get a weird symbol instead. Is it possible to get characters not in standard ASCII (or whatever the command line window is using)? Thanks in advance. ---------------------------------------------------------------------- derek.john.evans · 2015-08-10 17:23 WriteLn(#156); ---------------------------------------------------------------------- derek.john.evans · 2015-08-10 17:27 You can also try: 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 var  GIndex: Integer; begin  for GIndex in [32..255] do  begin    WriteLn(GIndex, ' = ', Char(GIndex));  end;  ReadLn;end. ---------------------------------------------------------------------- balazsszekely · 2015-08-10 17:52 Hi, Please read this thread: http://forum.lazarus.freepascal.org/index.php/topic,29174.0.html regards, GetMem ---------------------------------------------------------------------- eny · 2015-08-10 18:39 Quote from: DavidDMuir on August 10, 2015, 07:13:01 pmI am thinking about teaching school pupils to use Free Pascal with Lazarus and would like to start with simple command line programs rather than jumping straight into forms and buttons etc. Why not? The IDE already gives a barebones (working) template for a win gui program. Complexitity can be added gradually. And it's more fun. ---------------------------------------------------------------------- Leledumbo · 2015-08-11 04:03 Quote from: DavidDMuir on August 10, 2015, 07:13:01 pmWorked out I had to add a readln at the end of the programs to stop the output window disappearing before you could read it. No wrapper is used to execute your program. Therefore, as soon as it finishes, the console is closed as well. You can place a breakpoint at end. so the debugger will stop there and you could still see your program's output. Certainly this requires debug info to be active. Quote from: DavidDMuir on August 10, 2015, 07:13:01 pmI would like to display characters such as the GBP (i.e. £ sign) in the output window but I get a weird symbol instead. Is it possible to get characters not in standard ASCII (or whatever the command line window is using)? If you're using Windows, this depends on the used font as well. AFAIK Lucida Console is found to have the symbol, no idea with other fonts. On Linux the default font usually already works. ---------------------------------------------------------------------- DavidDMuir · 2015-08-12 14:07 Quote from: derek.john.evans on August 10, 2015, 07:23:45 pmWriteLn(#156); Quick and dirty. I like it. :-) Thank you for the prompt reply... and the next reply with printing out the whole character set was great too. David ---------------------------------------------------------------------- DavidDMuir · 2015-08-12 14:09 Quote from: GetMem on August 10, 2015, 07:52:26 pmHi, Please read this thread: http://forum.lazarus.freepascal.org/index.php/topic,29174.0.html regards, GetMem Thank you for this. Some useful stuff in that thread. I searched for posts related to £ signs but should have thought to search for other non-standard characters. David ---------------------------------------------------------------------- DavidDMuir · 2015-08-12 14:20 Quote from: eny on August 10, 2015, 08:39:28 pmQuote from: DavidDMuir on August 10, 2015, 07:13:01 pmI am thinking about teaching school pupils to use Free Pascal with Lazarus and would like to start with simple command line programs rather than jumping straight into forms and buttons etc. Why not? The IDE already gives a barebones (working) template for a win gui program. Complexitity can be added gradually. And it's more fun. Fair point. I am still working through a justification myself. At the moment, I am still leaning towards a bare bones introduction to Pascal. I'd like pupils to get their head around the basic concepts before cluttering things up with the extra code that inevitably gets added when you start fiddling around with GUIs. I accept that the GUI code is generated for you but (I think) it can be a distraction if you are coming completely new to programming. The pupils would progress to using the GUI but only once they had a bit of basic programming under their belt. Exactly how much constitutes "bare bones" and how quickly they move to a GUI, I haven't decided yet. I may be worrying unnecessarily but I still have very bad memories of teaching Visual Basic, where the GUI side was a positive hindrance to understanding the programming I was trying to teach. (Possibly down to my bad teaching rather than anything to do with VB or GUIs.) David ---------------------------------------------------------------------- DavidDMuir · 2015-08-12 14:25 Quote from: Leledumbo on August 11, 2015, 06:03:09 am<> If you're using Windows, this depends on the used font as well. AFAIK Lucida Console is found to have the symbol, no idea with other fonts. On Linux the default font usually already works. Thanks for this. I should have probably said I was using Windows 7... and yet, sensible answers have been given despite my poorly formed cry for help! Thanks again for replying. David ---------------------------------------------------------------------- Graeme · 2015-08-12 14:54 Quote from: DavidDMuir on August 12, 2015, 04:20:35 pmintroduction to Pascal. I'd like pupils to get their head around the basic concepts before cluttering things up with the extra code that inevitably gets added when you start fiddling around with GUIs. I fully agree with you David! Get the basics down first - language and compiler usage. I would even go as far as to say let them use a simple text editor (something with at least syntax highlighting - jEdit is very good) and compile from the command line too. The IDE itself could be a distraction (extra things to learn) too. ---------------------------------------------------------------------- Leledumbo · 2015-08-12 15:58 Quote from: Graeme on August 12, 2015, 04:54:57 pmQuote from: DavidDMuir on August 12, 2015, 04:20:35 pmintroduction to Pascal. I'd like pupils to get their head around the basic concepts before cluttering things up with the extra code that inevitably gets added when you start fiddling around with GUIs. I fully agree with you David! Get the basics down first - language and compiler usage. I would even go as far as to say let them use a simple text editor (something with at least syntax highlighting - jEdit is very good) and compile from the command line too. The IDE itself could be a distraction (extra things to learn) too. +1 with this, too. Making them understand as low as possible (the concept of language, compiler, compilation process, getting used to command line, etc.) but not lower (no asm, no binary file format) is a good way to learn programming. It's a shame that many programmers' can't differentiate between compiler and IDE...