×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
Does anyone have a working example of a complete subfile in C or C++ for
the AS400
Meaning:
1. Page down one specific page at a time
2. ADD
3. Change
4. Delete
5. Searchable headers.
Below are my example of load to end with none changeable on a subfile in C
or C++.
Thomas Burrows
R ENTRY
NAME 10A
PHONE 10A
A DSPSIZ(24 80 *DS3)
A CF03(03 'F3')
A*
A R SFL SFL
A NAME 10A B 10 25
A PHONE 10A B +5
A*
A R SFLCTL SFLCTL(SFL)
A SFLPAG(5)
A SFLSIZ(26)
A SFLDSP
A SFLDSPCTL
A*
A 21 25'<PAGE DOWN> FOR NEXT PAGE'
A*
A 22 25'<PAGE UP> FOR PREVIOUS PAGE'
23 25'F3 - EXIT'
DSPATR(HI)
/* This program uses _Ropen() to open subfile */
/* T1530DDG ad physical file T1520DDH */
/* The subfile is then initialized with records */
/* from the physical file */
/* Subfile records are written to the dispplng */
/* using the _Rwrited() function */
typedef struct
ä
char name^len!;
char phone^len!;
ü
pf_t;
#define RECLEN sizeof(pf_t)
init_subfile(pf, subf);
void init_subfile(_RFILE *, _RFILE *);
int main(void)ä
int num¬MAXLEN|; /* An array of digits. */
char letter??(MAXLEN??); /* An array of characters*/
/* Trigraphs replace the square brackets. */
_RFILE *pf;
_RFILE *subf;
/* Open the subfile and the physical file. */
if ((pf = _Ropen(PFILENAME, "rr")) == NULL)
ä
printf("can't open file %sÖn", PFILENAME);
exit(1);
ü
if ((subf = _Ropen(SUBFILENAME, "ar+")) == NULL)
ä
printf("can't open file %sÖn", SUBFILENAME);
exit(2);
ü
/* Initialize the subfile with records from the physical file */
init_subfile(pf, subf);
/* Write the subfile to the display by writing a record */
/* to the subfile control format. */
of main routine */ , "SFLCTL");
_Rwrite(subf, "", 0);
_Rreadn(subf, "", 0, __DFT);
for (i = 1; i <= NUM_RECS; i++)
/* open bracket level #1 */
ä
fb = _Rreadn(pf, &record, RECLEN, __DFT);
if (fb->num_bytes Ü= EOF)
/* open bracket level #2 */
ä
fb = _Rwrited(subf, &record, RECLEN, i);
if (fb->num_bytes Ü= RECLEN)
/* open bracket level #3 */
ä
printf("error occurred during writeÖn");
exit(3);
ü /* close bracket level #3 */
ü /* close bracket level #2 */
ü /* close bracket level #1 */
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.