Difference between revisions of "Talk:PChar"

From Lazarus wiki
Jump to navigationJump to search
Line 23: Line 23:
  
 
: @[[User:Bart|Bart]]:  I ''dislike'' to show ''faulty'' code in a ''full-blown'' syntaxhighlight box, so [[Special: Diff/146649|I’ve added]] merely another sentence. Is that OK? ‑‑[[User:Kai Burghardt|Kai Burghardt]] ([[User talk:Kai Burghardt|talk]]) 14:25, 3 September 2021 (CEST)
 
: @[[User:Bart|Bart]]:  I ''dislike'' to show ''faulty'' code in a ''full-blown'' syntaxhighlight box, so [[Special: Diff/146649|I’ve added]] merely another sentence. Is that OK? ‑‑[[User:Kai Burghardt|Kai Burghardt]] ([[User talk:Kai Burghardt|talk]]) 14:25, 3 September 2021 (CEST)
:: Yes, that's fine.
+
:: Yes, that's fine.--[[User:Bart|Bart]] ([[User talk:Bart|talk]]) 19:36, 3 September 2021 (CEST)

Revision as of 19:36, 3 September 2021

Spelling

I noticed that throughout this page the spelling "pChar" is used.
The type PChar is defined in the system unit (rtl/inc/systemh.inc), where the spelling is "PChar".
Also: this page is called "PChar".
I would propose to change all occurences of "pChar" with "PChar" (and "pAnsiChar" with "PAnsiChar"). --Bart (talk) 12:24, 29 August 2021 (CEST)

@Bart: Yeah, it’s a personal preference of me to use camelCase in identifiers, rather than CamelCase. Lowercase being the default, the capitalization of the first letter doesn’t improve readability. ‑‑Kai Burghardt (talk) 14:25, 3 September 2021 (CEST)

Direct assignments

The sample code is not very clear about what would make it crash. To me the phrasing suggsets that something like this should crash:

uses sysutils;
var
  p: pchar;
begin
  p := 'Hello';
  writeln(p);
  p := 'Hello World';
  writeln(p);
end.

The example in User Changes 3.0 however crashes, as promised. --Bart (talk) 12:37, 29 August 2021 (CEST)

@Bart: I dislike to show faulty code in a full-blown syntaxhighlight box, so I’ve added merely another sentence. Is that OK? ‑‑Kai Burghardt (talk) 14:25, 3 September 2021 (CEST)
Yes, that's fine.--Bart (talk) 19:36, 3 September 2021 (CEST)