nkuebelbeck
VIP Member
I've used rtrim in NER before and it appears to work. Looking at the c code it generates it gets messy. Is there a shipped JDE C api to trim leading/trailing white space?
I need to take two values and strncat them together, but the last string i'm trying to cat is a data structure dd value retrieved from a table and it appears right padded with spaces.
to prevent any overflows i'm trying this
jdeStrncat(dsF4108Update.iorlot,dsF4108.iorlot,DIM(dsF4108Update.iorlot) - jdeStrlen(dsF4108.iorlot) - 1);
the value is not being appended and i believe it because it's length is 30 already
EDIT
searching through some source i see an internal function whenever this is required
/**************************************************************************
* Function: I0800283_RightTrimSpaces
*
* Notes: This internal function will remove spaces on the right of the
* null-terminated string.
*
* Returns: NONE
*
* Parameters:
**************************************************************************/
static void I0800283_RightTrimSpaces(JCHAR *szString)
{
int iLength = 0;
iLength = jdeStrlen( szString );
while ( iLength > 0 && *(szString+iLength-1) == _J(' ') )
{
*(szString+(--iLength)) = _J('\0');
}
return;
}
I need to take two values and strncat them together, but the last string i'm trying to cat is a data structure dd value retrieved from a table and it appears right padded with spaces.
to prevent any overflows i'm trying this
jdeStrncat(dsF4108Update.iorlot,dsF4108.iorlot,DIM(dsF4108Update.iorlot) - jdeStrlen(dsF4108.iorlot) - 1);
the value is not being appended and i believe it because it's length is 30 already
EDIT
searching through some source i see an internal function whenever this is required
/**************************************************************************
* Function: I0800283_RightTrimSpaces
*
* Notes: This internal function will remove spaces on the right of the
* null-terminated string.
*
* Returns: NONE
*
* Parameters:
**************************************************************************/
static void I0800283_RightTrimSpaces(JCHAR *szString)
{
int iLength = 0;
iLength = jdeStrlen( szString );
while ( iLength > 0 && *(szString+iLength-1) == _J(' ') )
{
*(szString+(--iLength)) = _J('\0');
}
return;
}
Last edited: