PszAlloc Function | |
Copy a buffer pointed to by a PSZ to a newly allocated block of memory and return a new pointer to that memory.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax FUNCTION PszAlloc(
pszString AS PSZ
) AS PSZ
public static Psz PszAlloc(
Psz pszString
)
Request Example
View SourceParameters
- pszString
- Type: Psz
A null-terminated string.
Return Value
Type:
PszRemarks
The newly allocated string is a static object, which implies that the garbage collector does not move the string.
Remarks 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 displays the storage addresses of two variables:
1LOCAL pszString AS PSZ
2LOCAL pszOrigString AS PSZ
3pszOrigString := "Cavo tree"
4pszString := PszAlloc(pszOrigString)
See Also