The help file under INLINE mentions this function, but whenever I try to use it the compiler tells me that "class __GLBASIC__::DGStr has no member named 'GetStrData'".
Does the help file list the wrong name? or what should I be using here? Thanks.
Yes - it is wrong as that function no longer exists.
You get the string data by using something like :
char *data=m_str.c_str();
Need to update the information at some time.
Mr T. is correct, it looks like the manual needs a little edit. ;/
Yep it's easy get a pointer to the data, but how then do I allocate a buffer? without GetStrData the only way I can think of getting a specific size DGStr is:
FOR i = 1 TO Size
INC Buffer$, " "
NEXT
... which I can't see working very nicely or quickly :\
@Gernot (well anyone who knows the internal DGStr definition) is there another way I can allocate a string of a variable size? Some special constructor?
(Slightly related, could GLB get around strings "like \0 this" by having a constructor take a c-string and a length? That would be a lot easier than "like " + CHR$(0) + " this")
There is an alloc() function, which will allow you to defined a string to a set size. I dont know what it is initialise to initially though, so you should probably not depend on anything...
In addition there is also a setlength() function (which I think is the preferable one to use).
Alright I couldn't get setlength() to work, but alloc(int,bool) does seem to work (where the second boolean parameter seems to specify whether to copy the old string across).
Thanks for that - hopefully things won't be broken by this!
No - the only time anything would is if __GetPrpjectVersionGLB() got renamed :)