Recent

Author Topic: (Solved) PrintLn not found?  (Read 2506 times)

lainz

  • Hero Member
  • *****
  • Posts: 3807
  • Leandro Diaz
(Solved) PrintLn not found?
« on: October 08, 2020, 04:28:20 am »
Code: Pascal  [Select][+][-]
  1. program project1;
  2.  
  3. {$MODE Delphi}
  4.  
  5. uses
  6.   classes, sysutils;
  7.  
  8. function suma(const a: integer; const b: integer): integer;
  9. begin
  10.    result := a + b;
  11. end;
  12.  
  13. begin
  14.   println(suma(20, 20));
  15.   readln;
  16. end.
       
The program put a big red icon in the line 'println'.

The project I made was with Lazarus IDE. New project > Simple program.

Using Lazarus 2.0.10 and FPC 3.2.0

This is really strange, maybe something with my environment? I'm on Windows 10.
« Last Edit: October 08, 2020, 03:03:38 pm by lainz »
https://lainz.github.io/
Download LazPaint https://lazpaint.github.io/
Download BGRABitmap and BGRAControls https://github.com/bgrabitmap

bytebites

  • Sr. Member
  • ****
  • Posts: 345
Re: PrintLn not found?
« Reply #1 on: October 08, 2020, 04:58:30 am »
Have you tried
Code: Pascal  [Select][+][-]
  1. {$MODE Java}
  2. { System.out.println(suma(20, 20));
  3. }
  4.  

But what about writeln?

Cyrax

  • Hero Member
  • *****
  • Posts: 838
Re: PrintLn not found?
« Reply #2 on: October 08, 2020, 04:59:28 am »
Code: Pascal  [Select][+][-]
  1. program project1;
  2.  
  3. {$MODE Delphi}
  4.  
  5. uses
  6.   classes, sysutils;
  7.  
  8. function suma(const a: integer; const b: integer): integer;
  9. begin
  10.    result := a + b;
  11. end;
  12.  
  13. begin
  14.   println(suma(20, 20));
  15.   readln;
  16. end.
       
The program put a big red icon in the line 'println'.

The project I made was with Lazarus IDE. New project > Simple program.

Using Lazarus 2.0.10 and FPC 3.2.0

This is really strange, maybe something with my environment? I'm on Windows 10.

There is no such procedure like println in the RTL or as an compiler intrinsic. You probably mean WriteLn?

lainz

  • Hero Member
  • *****
  • Posts: 3807
  • Leandro Diaz
Re: PrintLn not found?
« Reply #3 on: October 08, 2020, 03:03:27 pm »
Sorry too much kotlin and java these days.

Thanks it works.
https://lainz.github.io/
Download LazPaint https://lazpaint.github.io/
Download BGRABitmap and BGRAControls https://github.com/bgrabitmap

winni

  • Hero Member
  • *****
  • Posts: 2005
Re: (Solved) PrintLn not found?
« Reply #4 on: October 08, 2020, 03:13:17 pm »

Code: Pascal  [Select][+][-]
  1. Procedure PrintLn (Int : Integer);
  2. begin
  3. writeln (Int);
  4. end;
  5.  

Sorry - could not resist

Winni

BobDog

  • Jr. Member
  • **
  • Posts: 68
Re: (Solved) PrintLn not found?
« Reply #5 on: October 08, 2020, 03:24:46 pm »

Trying to avoid java (if that is possible)
Code: Pascal  [Select][+][-]
  1.  
  2.  
  3.    {$macro on}
  4.   {$define println:=writeln}
  5.  
  6.  
  7.  function suma(const a: integer; const b: integer): integer;
  8. begin
  9.    result := a + b;
  10. end;
  11.  
  12. begin
  13. println(suma(20,20));
  14. println('Press enter to end . . .');
  15. readln;
  16. end.

jamie

  • Hero Member
  • *****
  • Posts: 3797
Re: (Solved) PrintLn not found?
« Reply #6 on: October 08, 2020, 03:26:42 pm »

Code: Pascal  [Select][+][-]
  1. Procedure PrintLn (Int : Integer);
  2. begin
  3. writeln (Int);
  4. end;
  5.  

Sorry - could not resist

Winni
I bet you are still smiling  :D
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018