VARPTR$ADDRESS FunctionWindows/Unix

A function that returns a null terminated string pointed by a given address.

Syntax: VARPTR$(address)
S$ = VARPTR$(279027343)


EXAMPLES:

$TYPECHECK ON
DefStr sTest = "This is a test string"
ShowMessage Varptr$(Varptr(sTest))  'shows This is a test string'
Application.Terminate


Use this function to return a string from a DLL or when an
API or a Window Message return a pointer to a string.
All you have then to do is :

DefStr MyString = Varptr$ (lpString)

Providing the string is a null terminated string. It will not work with a Unicode string. Also you can  convert a null terminated string to an RapidQ STRING.


EXAMPLE 2:
$TYPECHECK ON
DefStr sTest = "This is a test string" _
  & Chr$(0) & "Containing a Null char"
Print sTest ' prints the whole string
ShowMessage Varptr$(Varptr(sTest)) 'shows 'This is a test string'
Application.Terminate