idF4211Pointer

DamienXe

Active Member
Hi all!

Where can i find the idF4211Pointer(GENLNG) value for a F4211 Detail Row????

I need this variable as an input variable in a BSFN but i can´t find any BSFN which retrieve the F4211 Pointer.

Below a draft of the C-code which want the Pointer as an input value:

if (lpDS->idF4211Pointer == 0)
{
lpDS->cErrorCode = '1';
idReturnValue = ER_ERROR;
}
else
{
if (lpDS->cCallingMode == '2')
{
lpds4500130A->lpdsF4211 = (LPF4211)jdeRetrieveDataPtr(hUser,
lpDS->idF4211Pointer);

if (lpds4500130A->lpdsF4211 == (LPF4211)NULL)
{
lpDS->cErrorCode = '1';
idReturnValue = ER_ERROR;
}
else
{
bRecord = TRUE;
strcpy((char *)szLineType, (const char *)lpds4500130A->lpdsF4211->sdlnty);
}
}

All help is appreciated.
Thanx in advance
 
DamienXe,

Look here in your code fragment. . . there's a hint

if (lpDS->cCallingMode == '2')
{
lpds4500130A->lpdsF4211 = (LPF4211)jdeRetrieveDataPtr(hUser,
lpDS->idF4211Pointer);


See that 'jdeRetrieveDataPtr'?

Well, you'll use something similar in the program that calls B4500130.

Put this in your calling program. . . .

In the header:

#include <f4211.h>

In the 'c' file under 'Declare Pointers':

LPF4211 lpdsF4211 = (LPF4211)NULL;

Now, you have a place to put a memory pointer to F4211, which is what you're trying to achieve, really. The only special part is telling OneWorld to associate an Integer with it. That integer is GENLNG, or more commonly an ID.

So, in your code you'll place values into the lpdsF4211 data structure.

For instance, look at your code fragment again. . . . . . .:

strcpy((char *)szLineType, (const char *)lpds4500130A->lpdsF4211->sdlnty);


Can you see what this is doing? It's copying the Line Type from the lpdsF4211 structure. So, you'll need to fill your structure with all the data the B4500130 needs to use from your formula.

Back to your code:

In your function's "Declare Structures" section declare the data structure of the program you're CALLING. . (I'm sure you know all this)

DSD4500130 dsD4500130;

Fill that structure with the parameters to pass:

blah,
blah,
blah,

Now save your F4211 pointer into the B4500130 ID field (note, this is the magic you wanted!):

dsD4500130.idF4211Pointer = (ID)jdeStoreDataPtr(hUser, (void *)lpdsF4211);


There you go. . .I hope that answers your question.

By the way, I don't see B4500130 releasing the IDs, so you'll have to do that yourself when control returns to your program. If you don't, you'll have a memory leak.

lpdsF4211=(LPF4211)jdeRemoveDataPtr(hUser, dsD4500130.idF4211Pointer);

Notice that this function retrieves the pointer as well as release the ID. You don't care about getting that memory pointer since your program declared it, but consider it for the future when a called program needs to get that pointer AND release the ID. I hope that makes sence.

GOOD LUCK!
 
Back
Top