Click or drag to resize

Psz2String Function

Convert a null-terminated string to a strongly typed string.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.08
Syntax
 FUNCTION Psz2String(
	pszString AS PSZ
) AS STRING
View Source

Parameters

pszString
Type: Psz
A null-terminated string.

Return Value

Type: String
Remarks
Psz2String() can be used to do any necessary conversions before calling functions that expect a strongly typed string in their argument list.
Remarks
Tip Tip
The PSZ type is included in the X# language and runtime for compatibility only. In most cases the type can and should be replaced with normal strings.
If you need to interface with Win32 API functions that expect an ansi string, there is often also an alternative with a unicode string. We recommend to use that alternative when possible.
Examples
This example uses Psz2String() to convert a null-terminated string to a strongly typed string:
X#
LOCAL cMyBuffer AS STRING
LOCAL pszString AS PSZ
pszString := String2Psz("zero terminated")
cMyBuffer := Psz2String(pszString)
See Also