It would be nice if there was a .dba there that actually used the functions. This is just a renamed snip from the example. So follow the SDK you need this -> //Include Core (NOT optional).
TPC-Test.dba
`String Table
`IDS_STRING1 "REVERSESTR[%SS%ReverseStr%String"
MyStr1 as string
MyStr2 as string
MyStr1 = "ABC"
MyStr2 = "XYZ"
MyStr2 = REVERSESTR(MyStr1)
`Dont do this...
`MyStr2 = REVERSESTR(MyStr2, MyStr1)
`Or this...
`REVERSESTR[%SSS%ReverseString%String
`Because DWORD pOldString is supplied by DBP.
print MyStr1
print MyStr2
REVERSESTR.H
#define DLLEXPORT __declspec(dllexport)
extern "C" {
DLLEXPORT DWORD ReverseStr( DWORD pOldString, DWORD pStringIn );
}
//REVERSESTR.CPP
DWORD ReverseStr( DWORD pOldString, DWORD pStringIn ) {
// Delete old string
if(pOldString) g_pGlob->CreateDeleteString ( (DWORD*)&pOldString, 0 );
// Return string pointer
LPSTR pReturnString=NULL;
// If input string valid
if(pStringIn) {
// Create a new string and copy input string to it
DWORD dwSize=strlen( (LPSTR)pStringIn );
g_pGlob->CreateDeleteString ( (DWORD*)&pReturnString, dwSize+1 );
strcpy(pReturnString, (LPSTR)pStringIn);
// Reverse the new string
strrev(pReturnString);
}
// Return new string pointer
return (DWORD)pReturnString;
}