The RPG Program I have here does get the hidden field names and attributes.
For getting the basic stuff it works well.
I am converting it to C but I am stuck on converting this line of code
if QDFFFINF.WDFFFIOA = x'01'
I coded it in C as a strncmp but I get this compile error.
I tried many things to attempt to cast from const char* to char but I
(the C code of the program is here
It is a mix of the IBM code and the code I am converting , I am using the
IBM code as a guide to the conversion
also I must admit I dont really know what this code means
p_QDFFINFO = (QDFFINFO_t *)((char *) p_QDFFBASE + p_QDFFBASE->WDFFINOF);
I know it sets a pointer to the data but what does
(QDFFINFO_t *)((char *) mean ?
This is and example of the compile error I am getting.
218 17 | if (strncmp(p_QDFFFINF->WDFFFIOA, Attrib, 1) == 0)
218 17 + if ((_STRNCMPNULL((p_QDFFFINF->WDFFFIOA),(Attrib),(1))) ==
*=SEVERE==========> a - CZM0280 Function argument assignment between types
"const char*" and "char" is not allowed.
219 18 | NumFlds +=
220 | }
However there are other uses of strncmp in the program that compile just
253 4 | for (i=0; i<p_QDFFBASE->WDFFRCS; ++i)
254 5 | if (strncmp(p_QDFARFTE->WDFARFNM,MyRec,10) == 0)
255 6 | RecIndex = i + 1; /* Entry in QDFARFTE table for the
Thanks Buck for the insight on what to return.
I think I will just allocate an array in the caller and pass in a pointer
to the array
and see how that goes.
date: Mon, 18 Aug 2014 16:07:35 +0300
from: Jevgeni Astanovski <jevgeniast@xxxxxxxxx>
I used this program as a starting point and successfully retrieved
I needed the following:
Format name, field name, field I/O attribute (Input, Output, Both,
Hidden), field type and field length.
As wrote earlier my failure was with hidden fields.
I found one place where hidden fields names could be retrieved and
another place where I could find (probably) these fields necessary
attributes - but without field names!
Names where available for all but hidden....
As an Amazon Associate we earn from qualifying purchases.