Login
`
Templates, Tools and Utilities
|
||
Add a comment to an Icetips ArticlePlease add your comments to this article.
Please note that you must provide both a name and a valid email address in order
for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!
Back to article list Search Articles Add Comment Printer friendly Direct link Clarion in general: Copying data from string to cstring without triggering non-thread safe RTL calls 2002-12-17 -- Andy Ireland Newsgroups: comp.lang.clarion
> But "SomeStr = SomeCStr" ends up with a:
>
> call dword [c55runx.dll:Cla$PushCString] //Pushes a cstring onto the
> STRING stack
> ...
> call dword [c55runx.dll:Cla$PopCString] //Pops a cstring from the STRING
> stack (converting it as it goes)
> For the type conversion... Not safe!
Replace with....
MoveMemory(address(SomeStr), address(SomeCStr), len) where len is strlen
call from the VC++ RTL with null or not etc.
The problem is worse for num to string etc but itoa should be used in this
case. Also unsigned vars are processed using the stack therefore all values
are long and not ulong etc. You only need the correct number of bytes to
store it and not manipulate it as unsigned which accounts for 90% of usage
i.e pointers etc.
Regards
Andy
Plugware Solutions.com Ltd, taking the puzzle out of I.T
Tel : +44 1249 813335
Fax : +44 1249 813462
Today is November 23, 2024, 2:12 am This article has been viewed 35224 times. Google search has resulted in 321 hits on this article since January 25, 2004.
|
|