Re: [fpc-pascal] Printing terminal colors with writeln

2019-09-26 Thread geneb
On Thu, 26 Sep 2019, Ryan Joseph wrote: In C I can do: // https://stackoverflow.com/questions/4842424/list-of-ansi-color-escape-sequences printf("\033[31;1;4mHello\033[0m"); and get red text in the terminal (MacOS). When I do the same thing with writeln and FPC it prints the literal charact

Re: [fpc-pascal] for-in loop cast

2019-09-26 Thread Ryan Joseph
> On Sep 26, 2019, at 1:34 PM, Sven Barth via fpc-pascal > wrote: > > And we should probably add a proper TObject enumerator to TObjectList. > I just assumed that had to be there! I’ll make a generic replacement like Ben suggests. Regards, Ryan Joseph

Re: [fpc-pascal] Printing terminal colors with writeln

2019-09-26 Thread Ryan Joseph
> On Sep 26, 2019, at 4:46 PM, Jonas Maebe wrote: > > In C, \033 inside a string means "the ASCII character with octal value > 033". In Pascal, \033 instead a string means "\033". Use this instead: > writeln(#&033'[31;1;4mHello'#&033'[0m'); that’s why! thanks. Regards, Ryan Joseph __

Re: [fpc-pascal] Printing terminal colors with writeln

2019-09-26 Thread Tomas Hajny
On 2019-09-26 22:41, Ryan Joseph wrote: In C I can do: // https://stackoverflow.com/questions/4842424/list-of-ansi-color-escape-sequences printf("\033[31;1;4mHello\033[0m"); and get red text in the terminal (MacOS). When I do the same thing with writeln and FPC it prints the literal characters

Re: [fpc-pascal] Printing terminal colors with writeln

2019-09-26 Thread Jonas Maebe
On 26/09/2019 22:41, Ryan Joseph wrote: > In C I can do: > > // > https://stackoverflow.com/questions/4842424/list-of-ansi-color-escape-sequences > > printf("\033[31;1;4mHello\033[0m"); > > and get red text in the terminal (MacOS). When I do the same thing with > writeln and FPC it prints the

[fpc-pascal] Printing terminal colors with writeln

2019-09-26 Thread Ryan Joseph
In C I can do: // https://stackoverflow.com/questions/4842424/list-of-ansi-color-escape-sequences printf("\033[31;1;4mHello\033[0m"); and get red text in the terminal (MacOS). When I do the same thing with writeln and FPC it prints the literal characters with no colors. Why doesn’t this work

Re: [fpc-pascal] for-in loop cast

2019-09-26 Thread Ben Grasset
On Thu, Sep 26, 2019 at 11:59 AM Ben Grasset wrote: > -snip- > I meant to change the last part of the revised code example to: for value in list do because obviously the pointer cast is no longer necessary in that case. ___ fpc-pascal maillist -

Re: [fpc-pascal] for-in loop cast

2019-09-26 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Do., 26. Sep. 2019, 17:37: > Question I’ve always had. Why do I need to cast “value” to “pointer" > otherwise I get: Incompatible types: got "Pointer" expected “TObject” > error?. I don’t find this very helpful and it doesn’t really make sense > even. > > var > list: TObj

Re: [fpc-pascal] for-in loop cast

2019-09-26 Thread Ben Grasset
On Thu, Sep 26, 2019 at 11:37 AM Ryan Joseph wrote: > Question I’ve always had. Why do I need to cast “value” to “pointer" > otherwise I get: Incompatible types: got "Pointer" expected “TObject” > error?. I don’t find this very helpful and it doesn’t really make sense > even. > Well, TObjectLis

[fpc-pascal] for-in loop cast

2019-09-26 Thread Ryan Joseph
Question I’ve always had. Why do I need to cast “value” to “pointer" otherwise I get: Incompatible types: got "Pointer" expected “TObject” error?. I don’t find this very helpful and it doesn’t really make sense even. var list: TObjectList; value: TObject; begin for pointer(value) in list d