E9.1 Parse a String Text to Columns

FrankCLT

Well Known Member
Hi All,

I have a project where I need to parse a text field into columns, I found this function BQ670023, but although the input parameter (GPTX) is 1500 characters, anything more than 400 to 500 characters causes Object Browser to crash (what I'm using to test).

Anyone familiar with anything like this already out there?

Thanks,
FrankCLT
 
Good morning,

Trying this, but getting the following error.

H SPEC:
/*****************************************************************************
* Structure Definitions
****************************************************************************/
typedef struct
{
JCHAR szStringVariable1[101];

} DSTextParsed, *LPdsTextParsed;


C SPEC:
/************************************************************************
* Declare structures
************************************************************************/
DSTextParsed aTextParsed[20] = {0};


/************************************************************************
* Main Processing
************************************************************************/
/* Parse the text field into 20 segments */

for (i = 0; i < 20; i++)
{
jdeStrcpy(aTextParsed.szStringVariable1, lpDS->szInputText + (j * 100), 100);
}

This is the WARNING when I compile:::::

B56PARSE.c
C:\E910\DV910\source\B56PARSE.c(95) : warning C4020: 'jdeStrcpy' : too many actual parameters
 
Good morning,

Trying this, but getting the following error. Had to make a correction...there are brackets in the jdeStrCpy for the index.

H SPEC:
/*****************************************************************************
* Structure Definitions
****************************************************************************/
typedef struct
{
JCHAR szStringVariable1[101];

} DSTextParsed, *LPdsTextParsed;


C SPEC:
/************************************************************************
* Declare structures
************************************************************************/
DSTextParsed aTextParsed[20] = {0};


/************************************************************************
* Main Processing
************************************************************************/
/* Parse the text field into 20 segments */

for (i = 0; i < 20; i++)
{
jdeStrcpy(aTextParsed.szStringVariable1, lpDS->szInputText += (j * 100), 100);
}

This is the WARNING when I compile:::::

B56PARSE.c
C:\E910\DV910\source\B56PARSE.c(95) : warning C4020: 'jdeStrcpy' : too many actual parameters





[/i]
 
Last edited:
Good morning,

Trying this, but getting the following error.

H SPEC:
/*****************************************************************************
* Structure Definitions
****************************************************************************/
typedef struct
{
JCHAR szStringVariable1[101];

} DSTextParsed, *LPdsTextParsed;


C SPEC:
/************************************************************************
* Declare structures
************************************************************************/
DSTextParsed aTextParsed[20] = {0};


/************************************************************************
* Main Processing
************************************************************************/
/* Parse the text field into 20 segments */

for (i = 0; i < 20; i++)
{
jdeStrcpy(aTextParsed.szStringVariable1, lpDS->szInputText + (j * 100), 100);
}

This is the WARNING when I compile:::::

B56PARSE.c
C:\E910\DV910\source\B56PARSE.c(95) : warning C4020: 'jdeStrcpy' : too many actual parameters
jdeStrncpy - you missed the n

I have not tried to follow the other logic, but feel there are more obvious/transparent/safe methods than pointer arithmetic.
 
I've got lazy in old age and tend to build utility bsfns for stuff like csv, json etc using c library code pinched from the Internet or chatGPT.

I blame java/Groovy/Ruby for spoiling us with their endless libraries that have something for everything.
 
Back
Top