|
This is a multi-part message in MIME format. -- [ Picked text/plain from multipart/alternative ] Can someone find some 10 minutes to explain me, what am I doing wrong? I have a trivial display file named Y20DMD5: A DSPSIZ(24 80 *DS3) A CF03(03 'EXIT') A R CHRG A 3 2'Customer . . .' A CUSCPNC 6A B 3 17COLOR(WHT) A 61 ERRMSG('Error2') A CUSNAME 35A O 3 28 A 23 2'F3=Exit' A COLOR(TRQ) Then I have a trivial C program : #include <stdio.h> #include <stdlib.h> #include <recio.h> #include <string.h> #pragma mapinc("hdrf", "*LIBL/Y20DMD5(CHRG)", "both", "_P", "D1", "D1") #include "hdrf" #define INPUT_T D1_CHRG_i_t #define OUTPUT_T D1_CHRG_o_t #define IND_ON '1' #define IND_OFF '0' int main(void) { _RFILE *fp ; _RIOFB_T *rfb ; INPUT_T ScreenIn ; OUTPUT_T ScreenOut ; if ((fp = _Ropen("*LIBL/Y20DMD5", "rr+") ) == NULL) return(0) ; _Rformat (fp, "CHRG") ; ScreenOut.IN61 = IND_OFF ; memset(ScreenOut.CUSCPNC, ' ', 6) ; memset(ScreenOut.CUSNAME, ' ', 35) ; while (1) { rfb = _Rwrite(fp, &ScreenOut, sizeof(OUTPUT_T)) ; rfb = _Rreadn(fp, &ScreenIn, sizeof(INPUT_T), __DFT) ; ScreenOut.IN61 = IND_OFF ; if ((ScreenIn.IN03 == IND_ON)) { _Rclose(fp) ; return(0) ; } memset(ScreenOut.CUSNAME, 'A', 35) ; ScreenOut.IN61 = IND_ON ; memcpy(ScreenOut.CUSCPNC, ScreenIn.CUSCPNC, 6) ; } } It shows a customer prompt and when I enter customer it shows "Error1" on an error bar, but for some strange reason does not show, that the CUSNAME field has new value! At the same time, if I remove the row, setting IN61 to ON, everything is OK. What I want, is that it shows changed CUSNAME field AND ALSO an error text. Any advise will be highly appreciated! Thanks in advance, Jevgeni Astanovski. --
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.