Re: [fpc-pascal] Strings greater than 255 characters

2023-12-19 Thread James Richters via fpc-pascal
>3) There are some other smaller differences impacting compatibility with code designed to work with type shortstring (e.g. related to used character sets etc.). Here's a difference I discovered... I see that if I try to do something like: If MyString[1]='~' Then ... If MyString is an

Re: [fpc-pascal] Strings greater than 255 characters

2023-12-19 Thread Martin Frb via fpc-pascal
On 19/12/2023 12:36, James Richters via fpc-pascal wrote: I did notice that I cannot have a file of Ansistringsā€¦ Myfile : File of Ansistring; Causes a compiler error: Error: Typed files cannot contain reference-counted types. A "file of" must have a fixed size type. "file of word",

Re: [fpc-pascal] Strings greater than 255 characters

2023-12-19 Thread Peter B via fpc-pascal
On 19/12/2023 11:36, James Richters via fpc-pascal wrote: I did notice that I cannot have a file of Ansistringsā€¦ Myfile : File of Ansistring; Causes a compiler error: Error: Typed files cannot contain reference-counted types. I would just define the file as 'Text'. Can then Readln into an

Re: [fpc-pascal] Strings greater than 255 characters

2023-12-19 Thread Tomas Hajny via fpc-pascal
On 2023-12-19 12:36, James Richters via fpc-pascal wrote: Hello James, I keep getting bit by using STRING variables then trying to store more than 255 characters. My typical way to fix this is to just change it to an ANSISTRING. I'm wondering if there is any reason not to do this the other

[fpc-pascal] Strings greater than 255 characters

2023-12-19 Thread James Richters via fpc-pascal
I keep getting bit by using STRING variables then trying to store more than 255 characters. My typical way to fix this is to just change it to an ANSISTRING. I'm wondering if there is any reason not to do this the other way around and just go through My entire program and replace all the

[fpc-pascal] ordinal-type

2023-12-19 Thread Adriaan van Os via fpc-pascal
Michael Van Canneyt wrote: 29. Am I correct to assume ? ordinal-type = ordinal-type-identifier . ordinal-type-identifier = identifier . Yes. That may not be correct after-all, because an e.g. indexes arrays array-type = [ "PACKED" | "bitpacked" ] "ARRAY" [ "[" ordinal-type { ","