Re: [fpc-pascal] Read Field names from VMT

2023-12-27 Thread Amir via fpc-pascal
Thank you!On Dec 27, 2023 7:46 AM, Sven Barth via fpc-pascal wrote: Am 26.12.2023 um 21:29 schrieb Amir--- via fpc-pascal: On 12/26/23 01:14, Sven Barth via fpc-pascal wrote:

Re: [fpc-pascal] Procedures that work like WRITELN()

2023-12-27 Thread Wayne Sherman via fpc-pascal
On Wed, Dec 27, 2023 at 3:42 PM Wayne Sherman wrote: > Example using a TFileStream descendant and StreamIO AssignStream: > ...(line 42 follows) > FileWrite(TextRec(Output).Handle, Buffer, Count); Although that worked (I don't know why) I intended line 42 to be:

Re: [fpc-pascal] Procedures that work like WRITELN()

2023-12-27 Thread Wayne Sherman via fpc-pascal
Example using a TFileStream descendant and StreamIO AssignStream: program TeeStdOut; {$mode objfpc} uses Classes, SysUtils, StreamIO; type TTeeStream = class(TFileStream) Private FOriginalStdOut: Text; FNewStdOut: Text; public constructor Create(const AFileName: string;

Re: [fpc-pascal] Procedures that work like WRITELN()

2023-12-27 Thread Sven Barth via fpc-pascal
Am 27.12.2023 um 12:25 schrieb James Richters via fpc-pascal: I wanted to write what I thought should be a simple procedure, just instead of calling WRITELN() with some arguments, call WRITELOG() with the same arguments that you would use to write to a file, but my WRITELOG() procedure

Re: [fpc-pascal] Read Field names from VMT

2023-12-27 Thread Sven Barth via fpc-pascal
Am 26.12.2023 um 21:29 schrieb Amir--- via fpc-pascal: On 12/26/23 01:14, Sven Barth via fpc-pascal wrote: Amir--- via fpc-pascal schrieb am Di., 26. Dez. 2023, 07:03: Hi,    I want to retrieve the name of the fields in a record/class, at run time. It looks like

Re: [fpc-pascal] Procedures that work like WRITELN()

2023-12-27 Thread Wayne Sherman via fpc-pascal
On Wed, Dec 27, 2023 at 3:25 AM James Richters wrote: > I wanted to write what I thought should be a simple procedure, just instead > of calling WRITELN() with some arguments, call WRITELOG() with the same > arguments that you would use to write to a file, but my WRITELOG() procedure > would write

Re: [fpc-pascal] Procedures that work like WRITELN()

2023-12-27 Thread DougC via fpc-pascal
It would be very useful if WriteStr() was a function that returned the resulting string instead of returning it via an output parameter. Then you could just wrap the Writeln parameters in WriteStr() and pass it to the new logging procedure. Unfortunately, the ISO extension did not end up doing

Re: [fpc-pascal] Procedures that work like WRITELN()

2023-12-27 Thread James Richters via fpc-pascal
>Writeln() is special. You cannot duplicate it. That's good to know, I can stop trying. >What you can do is use WriteStr(), it has the same action as Writeln() but writes to a string instead of a file. I was hoping to just replace all existing Writeln()s with my procedure with a global search

Re: [fpc-pascal] Procedures that work like WRITELN()

2023-12-27 Thread Thomas Kurz via fpc-pascal
I think he wants to define his own procedure. The nearest thing that comes into my mind is using ARRAY OF CONST, but the call requires square brackets, then: procedure myproc (x: string; y: array of const); begin ... end; myproc ('Hello world', ['Number 1', 'Number 2', 3, 4.0]); -

[fpc-pascal] Daily snapshots?

2023-12-27 Thread Thomas Kurz via fpc-pascal
Hello, as it seems to take longer for the next major release, I'd appreciate if automated snapshots could be provided either daily or weekly. In the documentation, I found a link to ftp://ftp.freepascal.org/pub/fpc/snapshot/trunk/ but I cannot login. I tried with user=anynous and

Re: [fpc-pascal] Procedures that work like WRITELN()

2023-12-27 Thread Michael Van Canneyt via fpc-pascal
On Wed, 27 Dec 2023, James Richters via fpc-pascal wrote: I wanted to write what I thought should be a simple procedure, just instead of calling WRITELN() with some arguments, call WRITELOG() with the same arguments that you would use to write to a file, but my WRITELOG() procedure would

[fpc-pascal] Procedures that work like WRITELN()

2023-12-27 Thread James Richters via fpc-pascal
I wanted to write what I thought should be a simple procedure, just instead of calling WRITELN() with some arguments, call WRITELOG() with the same arguments that you would use to write to a file, but my WRITELOG() procedure would write to the screen and the file.. but I can't figure out how to