sunnyleung
New Member
Hello there,
Please tell me how to get the extent of the progress DB 's field name. here is an example:
abs_mstr
-----------------
abs_doc_data CHAR[5] x(08).
For each _file no-lock where _file-name = "abs_mstr", each _field of _file:
lstchp = lstchp + _field-name + ",".
End.
lstchp = Substring(lstchp,1,LENGTH(lstchp) - 1).
DO WHILE not qh:query-off-end with frame aa:
DO cpt = 1 TO num-entries(lstchp):
fieldname = bh:BUFFER-FIELD(ENTRY(cpt, lstchp)):NAME.
fieldlen=bh:BUFFER-FIELD(ENTRY(cpt, lstchp)):WIDTH-CHARS.
dataType=bh:BUFFER-FIELD(ENTRY(cpt, lstchp))ATA-TYPE.
fieldformat=bh:BUFFER-FIELD(ENTRY(cpt, lstchp)):FORMAT.
display fieldname dataType fieldlen fieldformat.
down 1.
END.
qh:GET-NEXT().
END.
qh:QUERY-CLOSE().
After running the following program the field-name is only abs_doc_data.
In fact, the field-name should be abs_doc_data[0] ... abs_doc_data[4].
Another question:
If I would like to get the value of field-name of array, How to do ?
Thanks,
Sunny.
Please tell me how to get the extent of the progress DB 's field name. here is an example:
abs_mstr
-----------------
abs_doc_data CHAR[5] x(08).
For each _file no-lock where _file-name = "abs_mstr", each _field of _file:
lstchp = lstchp + _field-name + ",".
End.
lstchp = Substring(lstchp,1,LENGTH(lstchp) - 1).
DO WHILE not qh:query-off-end with frame aa:
DO cpt = 1 TO num-entries(lstchp):
fieldname = bh:BUFFER-FIELD(ENTRY(cpt, lstchp)):NAME.
fieldlen=bh:BUFFER-FIELD(ENTRY(cpt, lstchp)):WIDTH-CHARS.
dataType=bh:BUFFER-FIELD(ENTRY(cpt, lstchp))ATA-TYPE.
fieldformat=bh:BUFFER-FIELD(ENTRY(cpt, lstchp)):FORMAT.
display fieldname dataType fieldlen fieldformat.
down 1.
END.
qh:GET-NEXT().
END.
qh:QUERY-CLOSE().
After running the following program the field-name is only abs_doc_data.
In fact, the field-name should be abs_doc_data[0] ... abs_doc_data[4].
Another question:
If I would like to get the value of field-name of array, How to do ?
Thanks,
Sunny.