Hello,
I just started to port my sources from PBDLL50 to PBDLL60
and ran into the following bug (?): In PBDLL50, you may
have asciiz pointers as members in a union. In PBDLL60,
they don't seem to work correctly:
If you run the following code snippet in the PBDLL60
debugger, only the first three characters (plus trailing
zero ?) of the string "powerbasic" will copied into the
destination location, instead of the full string. If you
run it in PBDLL50, it works just fine.
---------------------------------------
#compile exe
union uAdr
anything as dword
szPtr as asciiz ptr
end union
function pbmain()
local szString as asciiz * 80
local szPtr as asciiz ptr
local u as uAdr
szPtr = varptr(szString)
u.anything = szPtr
@szPtr = "powerbasic"
#debug print szString ' writes "powerbasic" <--- correct
[email protected] = "powerbasic"
#debug print szString ' writes "pow" <--- wrong
end function
---------------------------------------------
Maybe I am using an "old" version of the compiler (07-01-99) ?
Comment