IPB_Session interface:
ReleaseString method
Description
Frees the memory acquired using GetString, GetClassName, GetFieldName,
or GetEnumItemName.
Syntax
|
1 |
ReleaseString(LPCTSTR <span>string</span>) |
|
Argument |
Description |
|---|---|
|
string |
The string to be released from memory |
Return Values
None.
Examples
The following example gets a pointer to each of two
strings passed in as arguments, concatenates them in a new string,
then releases the memory used by the original strings:
|
1 |
pbstring psppcls:: f_add_string(IPB_Session* session, pbstring arg1, pbstring arg2)<br>{<br>   LPCTSTR pStr1,pStr2;<br>   TCHAR tmp[100];<br>   pbstring ret;<br> <br>   pStr1=session-> GetString(arg1);<br>   pStr2=session-> GetString(arg2);<br>   _tcscpy(tmp,pStr1);<br>   _tcscat(tmp,pStr2);<br>   ret = session -> NewString(tmp);<br>   session-> ReleaseString(pStr1);<br>   session-> ReleaseString(pStr2);<br> <br>   return ret ;<br> <br>} |
Usage
Do not use this function to release a string obtained using GetDateString, GetTimeString, GetDateTimeString,
or GetDecimalString. Each of these Get methods
has a corresponding Release method.
See Also
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest