Posted: 18th Apr 2003 23:49
Due to a lack of more useful string functions in DBP (i.e. TRIM$, SUBSTRING$, etc...) I have created a DBP include file with various functions that I, and hopefully someone else, find useful. You can download this at http://www.geocities.com/the_one_ring/string-extras/index.htm.

There are two downloads... The first is an installer package with the include files, PDF help, DBP on-line help files, updated keywords file, updated TEXT commands index file, and examples. The second is just a ZIP file with the include file and the PDF file.
Posted: 19th Apr 2003 0:03
I believe IanM did a Trim function. I've done a modified MID$ (which would act like SUBSTRING$), plus a few others.

Hate to point this out, but you may have wasted your time...
Posted: 19th Apr 2003 0:19
Plus a few other things

http://www.matrix1.demon.co.uk/DBPro/TPCDLL.html

Still, a replace function would be nice...
Posted: 19th Apr 2003 0:53
Cool. Just did it mostly for myself. Needed functions like TRIM, LTRIM, RTRIM, SUBSTRING, COUNTOCCURRENCES, FINDCHARACTER, EXTRACTFILEPATH, EXTRACTFILENAME...

What functions does your have?
Posted: 19th Apr 2003 1:05
The same trim functions as yours, MID$ instead of SUBSTRING, INSTR with the ability to specify a search starting position, MIN/MAX for all types, PEEK and POKE for all types. There are one or two other 'utility' type things in the same DLL too, and a few other DLLs on the same page.
Posted: 19th Apr 2003 1:09
Coolness. Yeah, I just checked out the link you listed. Nice... By the way... I'm having a problem with the TPC stuff. My DLLs work except when I try to call a core routine (i.e. CreateDeleteString). I get an exception... not sure why. I take out the call to g_pGlob->CreateDeleteString and the exception goes away... any ideas?
Posted: 19th Apr 2003 2:14
Sounds like your trying to pass a NULL pointer...

Its should be called something like this :

if (pOldString)
{
g_pGlob->CreateDeleteString ((DWORD*)&pOldString, 0 );
}

For deleting the original string, and then just something like :

g_pGlob->CreateDeleteString ((DWORD*)&lpStr, maxSize+1);
Posted: 19th Apr 2003 12:39
Download my utility DLL - it has all the source code included.

If you look in 'helper.h' you will find two inline functions call DeleteString and CreateString that I use all the time for DBPro strings.

Because they are defined as inline functions, they actually add *no* overhead to your executable.
Posted: 22nd Apr 2003 3:06
Now, I did this MrTAToad...
+ Code Snippet
g_pGlob->CreateDeleteString((DWORD*) &szResult, iLength + 1);
. I'm not sure what the deal is, but I have other strange issues... and just on this computer at home. It looks like I'm having serious DX9 issues... I may have to format and re-install...
Posted: 23rd Apr 2003 11:57
One thing I did forget to mention is that whenever you return a string, you need an extra parameter in your function (usually the first parameter), which apparently is the 'old' string. If you forget to put that in, you'll find that one of your other parameters goes missing...