|
Input File: 3 fields: key + field name + value ----------------------------------------------- PARTA INV001 30 PARTA INV003 40PARTA INV007 50
I want the output file to look as follows: key + values --------------------------------------------------------PARTA 30 <blank> 40 <blank> <blank> <blank> 50 There are a possibility of 999 different fields so I don't want to code a complicated SELECT. Any help would be appreciated. Thank you. Glenn Gundermann Tom Liotta writes:
rpg400-l-request@xxxxxxxxxxxx wrote:3. Field Value by Reference? (Martin, Steve (MAN-Golden))Using `Cursor field` on the RTNCSRLOC keyword in my display file, I can get the name of the field my cursor is on, for example, if/when I press a function key. How can I get the value of the field whose name is found in the `Cursor field`?Steve: Two possibilities come to mind at first: Look at the Retrieve Display File Description (QDFRTVFD) API. I haven't gone through that entire API, but you ought to be able to interpret your record buffer by using the results of the API. No trivial effort there. Sure seems best to have this all wrapped up in a procedure or three. Also look at the Retrieve Program Variable (QTERTVPV) API for OPM, or the whole set of debugger APIs for ILE (someone else will have to provide focused details). While this API requires some environment manipulation (debug) and compiled programs that keep variable names, it can work. I haven't done this from within the same program, but it might be worth a try. IOW, I don't think there's much choice within RPG itself. But then again, if you write the program, you can make it do pretty much anything.Tom Liotta
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.