i am trying to use varptr to check to see if the pointer for an
asciiz string argument is null, but using varptr itself with the
null string causes an error. here's what i did:
in another forum message, asciiz empty..., i explained the problem
i was having. i was given the solution of checking the asciiz
argument for null before using it, to avoid a crash later on.
after praising the solution, i tried it again later, and it
didn't work. my last response there may have gone unoticed, so
i'm posting this in a new thread hoping to find another way
around this problem.
basically the situation is that there's a sub which takes
an asciiz argument. i want to avoid the gpf that can happen if
an empty string is passed to that routine.
------------------
daniel corbier
ucalc fast math parser
http://www.ucalc.com
asciiz string argument is null, but using varptr itself with the
null string causes an error. here's what i did:
Code:
$compile exe $debug error on sub test(asciizarg as asciiz) if varptr(asciizarg) = 0 then temp$ = " else temp$ = asciizarg msgbox str$(err) ' returns error #9 end sub function pbmain as long call test(") end function
i was having. i was given the solution of checking the asciiz
argument for null before using it, to avoid a crash later on.
after praising the solution, i tried it again later, and it
didn't work. my last response there may have gone unoticed, so
i'm posting this in a new thread hoping to find another way
around this problem.
basically the situation is that there's a sub which takes
an asciiz argument. i want to avoid the gpf that can happen if
an empty string is passed to that routine.
------------------
daniel corbier
ucalc fast math parser
http://www.ucalc.com
Comment