c := XSharp.Core.Functions.CHR(196u) // still pointing to the core function chr()
dw := Asc("Ž") // ok, points to the Asc() func in the created exe
Any ideas what the problem with "Chr" might be ?
Code: Select all
_DLL FUNCTION MessageBox(hwnd AS intptr , lpText AS STRING, lpCaption AS STRING, uType AS DWORD);
AS INT PASCAL:USER32.MessageBoxA ANSI
#define _OVERRIDE_ASC_AND_CHR_
#ifdef _OVERRIDE_ASC_AND_CHR_
FUNCTION CHR (dwChar AS DWORD ) AS STRING
? "Chr() override"
RETURN XSharp.Core.Functions.ChrA ( dwChar )
FUNCTION Asc (c AS STRING ) AS DWORD
? "Asc() override"
RETURN XSharp.Core.Functions.AscA(c )
#endif
FUNCTION Start() AS VOID
LOCAL dw AS DWORD
LOCAL c AS STRING
c := CHR( 196 ) // should show "Ä"
dw := asc ( "Ž" ) // should show 142
messagebox ( NULL , c + chr(13) + chr(10) + ntrim ( dw ) , "" , 0 )
RETURN
Karl-Heinz