X# 2.10 and String2Psz() in struct members
Posted: Wed Feb 02, 2022 4:34 pm
Dear X# DevTeam!
The new X# 2.10 compiler has a new warning "String2Psz() and Cast2Psz() should only be used for variables that have a 'local' scope. The allocated PSZ will be automatically released once the current function/method ends."
Imagine a struct (Either global or local) strLine containing a PSZ member called pTitle; currently the compiler throws a warning when assigning data to this member.
What is the proper way to assign the data?
BR,
Bernhard
The new X# 2.10 compiler has a new warning "String2Psz() and Cast2Psz() should only be used for variables that have a 'local' scope. The allocated PSZ will be automatically released once the current function/method ends."
Imagine a struct (Either global or local) strLine containing a PSZ member called pTitle; currently the compiler throws a warning when assigning data to this member.
Code: Select all
// current code
strLine:pTitle := String2Psz(oData:ItemNo) // oData:ItemNo = string variable
BR,
Bernhard