FPC 3.2.2 - fpc_char_to_ansistring - lazarus / 62-General ---------------------------------------------------------------------- paule32 · 2024-10-27 08:55 Hi, I am again  On my own system.pas, I get faced with this Code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var  S1: String;  ch: Char;begin  S1 := S1 + ch;end; and I get this message: Error: Incompatible type for arg no. 3: Got "AnsiString", expected "Pointer" for: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function  fpc_char_to_ansistr (const c : Char; cp : TSystemCodePage): AnsiString; compilerproc; I get no system error about my own system.pas - only the Error above. Has it to do with system.pas ? How can I fix this issue ? Thanks for helping hands paule32 ---------------------------------------------------------------------- Fibonacci · 2024-10-27 09:28 You got 2 args in this proc, the error is probably in: fpc_ansistr_concat as its called right after. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure fpc_ansistr_concat(var dst: Pointer; const S1,S2: Pointer; cp: DWORD); compilerproc;var    S1Len, S2Len, S3Len: SIZE_T;    DestS: Pointer;begin    S1Len := strlen( S1 );    S2Len := strlen( S2 );      dst := VirtualAlloc(nil, S1Len + 1,    MEM_COMMIT or MEM_RESERVE, PAGE_READWRITE );        if not (dst = nil) then    begin        FillChar( dst, S1Len, #0 );        strcpy( dst, S1 );        strcat( dst, S2 );    end else    begin        MessageBox( 0, 'Error: fpc_AnsiStr_Concat memory allocation fail.', 'Error', 0 );        ExitProcess( 1 );    end;end; How does my code in RTL look and it works: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure fpc_ansistr_concat(var dests: RawByteString; const s1, s2: RawByteString; cp: TSystemCodePage); compilerproc;begin  pointer(dests) := new_ansistring(length(s1)+length(s2));  move(s1[1], dests[1], length(s1));  move(s2[1], dests[length(s1)+1], length(s2));end; You can see it at my private repo you have access to. EDIT: Or, edit your fpc_char_to_ansistr to return Pointer, not AnsiString; BTW. it currently doesnt return anything. ---------------------------------------------------------------------- paule32 · 2024-10-27 10:17 Thanks. - Your Code and effort looks good. - You are on the right way - some parts, I have stolen for own tests. - You made the projects private - for a surprise :-) ? - You take effort for x86 i386 ? - my own takes for x86_64 it is good to hear, and see, that both ABI's are introduce. ---------------------------------------------------------------------- Fibonacci · 2024-10-27 10:23 I work on x86 (easier to debug), but the goal is to make it work on both. I have no idea if it compiles for x64. I dont see why it wouldnt. The repo is private because Im shy I will open it to public when the time is right. ---------------------------------------------------------------------- paule32 · 2024-10-27 11:11 I did start the documentation - you have see it ? They comes in three version's - html, pdf, and chm. And these I would provide two version's - English, and German with help of doxygen. Doxygen is currently/mainly available for C/C++ source code documentation. But like you can see, it can both PAS and CPP. ---------------------------------------------------------------------- Fibonacci · 2024-10-27 11:32 Imho, potential users of this project are likely familiar with FPC, so they don't need explanations on things like FOR loops. The official FPC documentation covers that. Your documentation should only include topics that differ from standard FPC, highlight any missing features that might be expected to exist, or introduce to new features that aren't available in the original FPC. Let's move this discussion in our GitHub "organization"  Folks here aren't really interested in our somewhat "private" conversation. They're even starting to act weird when the topic of a "custom RTL" comes up and are trying to dissuade you from pursuing it. EDIT: removed this part cos you removed your edit