Kevin A. Foss wrote:
Also is {$x+} really error detection off?
No, it's eXtended syntax: CStrings, pointer arithmetics, etc.
Is there a guide to all of the different String functions for conversion and what not?
Not yet, sorry. Writers welcome.
Also noticed the function twine in the interface doesn't match function twine in the implementation. It didn't trigger an error message but I don't know if that's a bug or a extended pascal "extension".
Um, I thought it was exactly how EP was supposed to work, you define all of the argument and return types in the interface and just give the function name in the implementation.
Indeed.
In the rewrite which follows couldn't return a CString so changed it to a string. Think this is a language restriction. ( However it could be me )
This is weird, my own rewrite of the interface works fine returning CStrings, had no problem. You have to fix the 'twine :=' line in the module and the writeln in the main program.
If you return a CString you must keep in mind that it is a pointer to some array. You must not let it point to a local variable that will vanish when the function exits. You can allocate memory for that variable using GetMem, but then you must remember to FreeMem (or Dispose) it once the function result is not needed any more. In any case, CStrings are a kludge; better avoid them. ;-)
Peter