Re: [Gambas-user] About StrPtr()

2010-12-12 Thread Demosthenes Koptsis
ok i made this example PUBLIC SUB Main() DIM p AS Pointer DIM s AS String DIM a AS String = "this is a string" & Chr$(0) PRINT Len(a) PRINT InStr(a, Chr$(0)) p = Alloc(a) 'READ #p, s s = StrPtr(p) PRINT Len(s) PRINT InStr(s, Chr$(0)) Free(p) END - Before

Re: [Gambas-user] About StrPtr()

2010-12-12 Thread Benoît Minisini
> 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 >

Re: [Gambas-user] About StrPtr()

2010-12-12 Thread Demosthenes Koptsis
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 wa

Re: [Gambas-user] About StrPtr()

2010-12-11 Thread Benoît Minisini
> i made an example for StrPtr, it is the next one, > > ' Gambas module file > > PUBLIC SUB Main() > > DIM p AS Pointer > DIM s AS String > > p = Alloc("this is a string") > > 'READ #p, s > s = StrPtr(p) > PRINT s > Free(p) > > END > > I just want to question what is the difference between >

[Gambas-user] About StrPtr()

2010-12-09 Thread Demosthenes Koptsis
i made an example for StrPtr, it is the next one, ' Gambas module file PUBLIC SUB Main() DIM p AS Pointer DIM s AS String p = Alloc("this is a string") 'READ #p, s s = StrPtr(p) PRINT s Free(p) END I just want to question what is the difference between 'READ #p, s s = StrPtr(p) both of the