Re: Business Function for String Manipulation


VIP Member
Re: Business Function for String Manipulation

The original post. . . .

I (non "C" programmer) have a need to parse Media Object Text. I created a
business function to accept the media text as an input parameter along with
a delimiter value. The business function will not build because of the
following error. Any ideas on how to do this ?
C:\Program Files\Microsoft Visual Studio\VC98\include\eh.h(32) : fatal error
C1189: #error : "eh.h is only for C++!"

Here's an extract of the source code:
#include <string>
using std::string;

// Variables
string s1, s2;
int startPos, endPos;

// Main
string s1( lpDS-> MediaObjectVariableLengthC );
startPos = s1.find( lpDS->szFunctionCode );
endPos = s1.find( lpDS->szFunctionCode_2, startPos + 1 );
s2 = s1.substr( (startPos + 3), (endPos - (startPos + 3)) );
lpDS->szCurrentText = s2;

xe sp16 as400 v4r5

This doesn't work because it's all C++ code. OneWorld BSFNs all have to be plain ANSI C. You can get away with WIN32 code in many cases, but that's still just C, not C++. I suspect you copied this from a C++ book, so I recommend you get hold of a C book to copy from instead. "Plagiarism" is the programmers mantra by the way, so there's no shame in copying out of a book.

Darren Ricciardi - OneWorld Whipping Boy

Looking for work in OR NEAR Amsterdam THE NETHERLANDS