According to Frank Heckenbach:
(* Peter, was this what we intended to do, or did I confuse anything? ;*)
I am not sure. ;-)
Actually, for sometime later we have planned to build the following functions into the compiler:
- One that just appends the #0 and returns the addres of the first character of the string (solves problem 2; not 3; problem 1 will be solved by making strings internally bigger than declared by 1 char). For short strings (when they will be introduced), this function will make a temporary copy on the stack (because they must be BP compatible so there will not always be space for the #0 in the string).
Yup.
- One that always makes a copy on the stack and copies the string into it. That's the secure way, but inefficient with very long strings.
Concerning CStrings? You mean a switch?
One that allocates the memory on the heap. This is needed when the resulting CString is to be used outside of the current scope (when it's not only passed to a function).
One that copies the string in a buffer allocated by the programmer (this is perhaps only for compatibility with BP's StrPCopy).
What functions do you mean? Built-in replacements for BP's functions from the `Strings' Unit?
Peter
Dipl.-Phys. Peter Gerwinski, Essen, Germany, free physicist and programmer peter.gerwinski@uni-essen.de - http://home.pages.de/~peter.gerwinski/ [971005] maintainer GNU Pascal [971001] - http://home.pages.de/~gnu-pascal/ [971005]