good idea. I also had the idea to assign the string equate to a static/global string, but didn't thought about using an array

Aldo
------------------
#if not %def(%TEXT_INC) %TEXT_INC = 1 %TEXT = 1 %FreeTEXT = 2 global TEXTMemory() as string ' Would be better as static inside MainTEXTfunc. Not safe in current version of PB. function MainTEXTfunc(byval func_id as long, byval s as string) as dword static n as long select case func_id case %TEXT redim preserve TEXTMemory(n) TEXTMemory(n) = s incr n function = strptr(TEXTMemory(n-1)) : exit function case %FreeTEXT n = 0 redim TEXTMemory(0) end select end function function TEXT(byval s as string) as dword function = MainTEXTfunc(%TEXT, s) end function sub FreeTEXT() MainTEXTfunc %FreeTEXT, "" end sub #endif '%TEXT_INC
wc.lpszClassName = TEXT( AsciizVariable ) wc.lpszClassName = TEXT( StringVariable ) wc.lpszClassName = TEXT( $StringEquate ) wc.lpszClassName = TEXT( "MyClassName" )
LOCAL wc as WndClassEx ... wc.lpszClassName = VARPTR( AsciizVariable ) ... RegisterClassEx wc
wc.lpszClassName = STRPTR( StringVariable )
wc.lpszClassName = VARPTR( $StringEquate )
' These all pass bycopy: CALL apifunction(BYCOPY $MyString) ' Explicit BYCOPY CALL apifunction($MyString + "") ' Expressions passed BYCOPY CALL apifunction(($MyString)) ' Parentheses force evaluation as an expression, hence BYCOPY
$a = "Aldo Cavini" b = STRPTR( $a )
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: