> i just compared the output
> with PRINT s and i saw the same result.
> 
> i was wrong because i did not know about string manipulation in c.
> i did not understand the zero terminated string you mentioned in help.
> 
> i found some info at this page
> http://www.dfstermole.net/OAC/hstrings.html
> 
> Is there any way to produce a zero terminated string in Gambas to
> demostrate the StrPtr()?
> 

Yes, but I don't want to really explain that, as it is internal interpreter 
stuff.

Even if Gambas always knows the length of a string (by storing it with the 
string contents for example), all strings created by Gambas are zero-
terminated string. 

*But*, Gambas does not always create strings. For example, many string 
manipulation functions (Mid$, Left$, Right$, Trim$...) do not really create 
strings to be faster, and so do not return zero-terminated strings 
necessarily.

So, to be sure, just create a string with an explicit Chr$(0) at its end.

Regards,

-- 
Benoît Minisini

------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages, 
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev 
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to