Recent

Author Topic: Looking for some basic functions(commands)?  (Read 2532 times)

Ricardo T.

  • New Member
  • *
  • Posts: 13
Looking for some basic functions(commands)?
« on: October 01, 2018, 09:32:35 pm »
Hello u all!  ;)

This is my 2nd post ever,i joined the forum last night.

Is this the right place to ask questions about FP programming?. I'm a complete beginner,i just wrote my very first program last night, the Hello World code  :D

I learned about the writeln,readln functions plus how to write comments in the code  :D so far so good but,
i have a couple of questions...

is there a function to clear the screen when the program starts running? like cls on the win cmd.

how can i print colored text on the screen?

is it posible to set the cursor (x,y) to display text?

Thanks...

Ricardo T.

Bart

  • Hero Member
  • *****
  • Posts: 5290
    • Bart en Mariska's Webstek
Re: Looking for some basic functions(commands)?
« Reply #1 on: October 01, 2018, 09:46:54 pm »
See the crt unit.

Code: Pascal  [Select][+][-]
  1. uses
  2.   crt;
  3. begin
  4.   ClrScr;
  5.   GotXY(10,10);
  6.   write('Hello World');
  7.   GotXY(10,20);
  8.   write('Press Enter');
  9.   readln;
  10. end.

Bart

Ricardo T.

  • New Member
  • *
  • Posts: 13
Re: Looking for some basic functions(commands)?
« Reply #2 on: October 02, 2018, 02:10:28 am »
Bart... Thanks a lot,just what i was looking for.  :)

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: Looking for some basic functions(commands)?
« Reply #3 on: October 02, 2018, 10:03:11 am »
@Bart: GotoXY, not GotXY.

For the color https://www.freepascal.org/docs-html-3.0.0/rtl/crt/textcolor.html
Usually it is a good idea to read manuals. That's what they are for.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

Bart

  • Hero Member
  • *****
  • Posts: 5290
    • Bart en Mariska's Webstek
Re: Looking for some basic functions(commands)?
« Reply #4 on: October 02, 2018, 04:31:38 pm »
@Bart: GotoXY, not GotXY.

Well spotted.

My keyboard does not like me  :(

Bart

 

TinyPortal © 2005-2018