[Gambas-user] [Fwd: Gambas3 Pointers example] signal #6

Benoît Minisini gambas at ...1...
Tue Jan 11 19:47:42 CET 2011


> > if i use
> > s=Str@(pPointer)
> > 
> > this means
> > address1=adress2 ?
> 
> Kind of... even this doesn't change the situation:
> 
> sTmp = Str@(pPointer)
> s = sTmp
> 
> I'm not sure this is good thing, may cause weird bugs and confusion!
> I think this is because strings are objects in Gambas...
> maybe Str@() should do internal copy of data, instead of association
> object1 = object2?
> 
> What do you think Benoit?
> 
> Jussi

That both of you should read the wiki page about String@ (or Str@ or StrPtr). 
:-)

It returns a constant string. A constant string is just a pointer (and a 
length), no data is copied or allocated. String@ assumes that the pointer 
points at constant data that will not change.

Regards,

-- 
Benoît Minisini




More information about the User mailing list