Recent

Author Topic: writeln output string length  (Read 703 times)

freemind001

  • New Member
  • *
  • Posts: 35
writeln output string length
« on: February 21, 2024, 10:02:53 pm »
Code: Pascal  [Select][+][-]
  1. procedure Log(EventType: TEventType; aMessage: string; StdOutputOnly: boolean);
  2. begin
  3.     if StdOutputOnly then
  4.       writeln(aMessage)
  5.     else
  6.     begin
  7.       writeln(aMessage);
  8.       AppEventLog.Log(EventType, aMessage);
  9.     end;
  10. end;        

writeln(aMessage) output length is only 256 symbols, why?

if i do
Code: Pascal  [Select][+][-]
  1. writeln('{1000 symbols here...}');
it's ok, but
Code: Pascal  [Select][+][-]
  1. writeln(aMessage + '{1000 symbols here...}');
still has the limitation
« Last Edit: February 21, 2024, 10:05:41 pm by freemind001 »

Thaddy

  • Hero Member
  • *****
  • Posts: 16194
  • Censorship about opinions does not belong here.
Re: writeln output string length
« Reply #1 on: February 21, 2024, 10:06:16 pm »
{$H+}
If I smell bad code it usually is bad code and that includes my own code.

rvk

  • Hero Member
  • *****
  • Posts: 6586
Re: writeln output string length
« Reply #2 on: February 21, 2024, 10:13:20 pm »

freemind001

  • New Member
  • *
  • Posts: 35
Re: writeln output string length
« Reply #3 on: February 21, 2024, 10:15:22 pm »
works, thank you
can I use it together with {$mode objfpc}?

rvk

  • Hero Member
  • *****
  • Posts: 6586
Re: writeln output string length
« Reply #4 on: February 21, 2024, 10:18:14 pm »
Yes. Normally if you create a default program with lazarus, this is already automatically added at the top.

Code: Pascal  [Select][+][-]
  1. {$mode objfpc}{$H+}

Thaddy

  • Hero Member
  • *****
  • Posts: 16194
  • Censorship about opinions does not belong here.
Re: writeln output string length
« Reply #5 on: February 22, 2024, 06:57:30 am »
or use {$mode delphi} where {$H+} is implied. (the only mode where that is the case)
If I smell bad code it usually is bad code and that includes my own code.

 

TinyPortal © 2005-2018