|
Did any lines of RPG code get processed? Did the program advance past the exfmt line? --------------------------------- Booth Martin http://www.martinvt.com --------------------------------- -------Original Message------- From: RPG programming on the AS400 / iSeries Date: 10/24/05 18:36:16 To: RPG programming on the AS400 / iSeries Subject: RE: subfile SFLFOLD/SFLDROP and cursor positioning Here is my code. I have assigned CF14 to the FOLD/UNFOLD function, but I could not inactivate it. I programmatically assigned CF13 to the FOLD/UNFOLD function. The key is *IN10 which controls the FOLD/UNFOLD and the SFL10MODE which stores the current state. This code successfully returned each time and flipped the FOLD/UNFOLD switch. The Display File: A*%%TS SD 20051024 160946 MARVINR REL-V5R1M0 5722-WDS A*%%EC A DSPSIZ(24 80 *DS3) A PRINT A ERRSFL A WDWBORDER((*COLOR BLU) (*DSPATR RI)- A (*CHAR '+-+||+-+')) A CF01(15) A CF02(15) A CF03(15) A CF04(15) A CF05(15) A CF06(15) A CF07(15) A CF08(15) A CF09(15) A CF10(15) A CF11(15) A CF12(15) A CF13(15) A N10 10 CF14(15) A CF15(15) A CF16(15) A CF17(15) A CF18(15) A CF19(15) A CF20(15) A CF21(15) A CF22(15) A CF23(15) A CF24(15) A*----------------------------------- A* BASIC SUBFILE FOR SCREEN INTERACTIVE A*----------------------------------- A R REC10S SFL A*%%TS SD 20051024 160454 MARVINR REL-V5R1M0 5722-WDS A SCSEL 1A B 7 3DSPATR(HI) A DSPATR(PC) A 7 6'Line #1---------------------------- A ------------------------------------ A -----' A 8 6'Line #2+++++++++++++++++++++++++++- A +++++++++++++++++++++++++++++++++++- A +++++' A 9 6'Line #3===========================- A ===================================- A =====' A*------------------------------------------- A* BASIC CONTROL FILE FOR SCREEN INTERACTIVE A*------------------------------------------- A R REC10C SFLCTL(REC10S) A*%%TS SD 20051024 160946 MARVINR REL-V5R1M0 5722-WDS A SFLSIZ(0050) A SFLPAG(0005) A N77 PAGEDOWN(16) A RTNCSRLOC(*RECNAME &#REC10 &#FLD10 - A &#POS10) A SFLCSRRRN(&#CSR10RRN) A SFLMODE(&SFL10MODE) A 75 SFLDSP A N76 SFLDSPCTL A 76 SFLCLR A 77 SFLEND(*MORE) A 10 SFLDROP(CF14) A N10 SFLFOLD(CF14) A #CSR10RRN 5S 0H A*N10 SFLDROP(CF16) A* 10 SFLFOLD(CF16) A #POS10 4S 0H A #FLD10 10A H A #REC10 10A H A #RRN10 4S 0H SFLRCDNBR(CURSOR) A SFL10MODE 1A H A 1 3DATE A EDTCDE(Y) A COLOR(BLU) A 1 70USER A COLOR(BLU) A 2 3TIME A COLOR(BLU) A 2 70SYSNAME A COLOR(BLU) A 6 2'Title Bar ------------------------- A ------------------------------------ A ---------' A COLOR(YLW) A 1 35'Company Name' A 5 80' ' A 2 34'Program Title' A DSPATR(UL) A*------------------------------------------- A* ERROR MESSAGE SUBFILE RECORD A*------------------------------------------- A R REC10SE SFL A*%%TS SD 20030706 005407 MARVINR REL-V5R1M0 5722-WDS A SFLMSGRCD(24) A MSGKEY SFLMSGKEY A QM_MSGQ SFLPGMQ(10) A*----------------------------------------------- A* MESSAGE CONTROL RECORD FOR SCREEN INTERACTIVE A*----------------------------------------------- A R REC10CE SFLCTL(REC10SE) A*%%TS SD 20050831 091405 MARVINR REL-V5R1M0 5722-WDS A RTNCSRLOC(*RECNAME &#RECORD &#FIELD- A &#POSITION) A FRCDTA A OVERLAY A SFLDSP A SFLDSPCTL A SFLINZ A 98 SFLEND A SFLSIZ(0002) A SFLPAG(0001) A #POSITION 4S 0H A #FIELD 10A H A #RECORD 10A H A QM_MSGQ SFLPGMQ(10) A 23 3'F3=Exit' A COLOR(BLU) A DSPATR(UL) A 23 12'F12=Cancel' A DSPATR(UL) A COLOR(BLU) A 23 24'F6=Add Item' A COLOR(BLU) A DSPATR(UL) A 23 37'F16=Fold/Unfold' A COLOR(BLU) A DSPATR(UL) And the RPGLE: /title TESTFOLDR - Test Fold/UnFold /copy qrpglesrc,hspecs '*%D****************************************************************** '*%D 1. TESTFOLDR: Test Fold/UnFold '*%D '*%D 2. Description '*%D '*%D 3. Compile Instructions '*%D '*%D 4. Procedure '*%D '*%D 5. Date User ID Description of change '*%D 10/24/05 MarvinR Intial Creation '*%D '*%D 6. Indicator Summary '*%D Ind Alt Name Desciption '*%D 10 SFL Mode Fold/Unfold Mode Flag '*%D 60 FilterChange Filter Fields Changed '*%D 75 sfl10dsp Display Subfile '*%D 76 sfl10clr Clear Subfile '*%D 77 sfl10end End of Subfile (End of Data File) '*%D 98 msgsflend Message Subfile End '*%D 99 GeneralError General Error Flag '*%D '*%D 7. Procedure Interface '*%D Name: TESTFOLDR '*%D '*%D Parameters: '*%D Name Description '*%D '*%D Gobals: *None '*%D '*%D Returns: *None '*%D '*%D 8. Example '*%D Call TESTFOLDR '*%D****************************************************************** /EJECT '*------------------------------------------------------------- '* File Specs '*------------------------------------------------------------ Ftestfoldd cf e workstn F sfile(rec10s:#rrn10) '*------------------------------------------------------------ '* Input Specs '*------------------------------------------------------------ '* Import Fields '*------------------------------------------------------------ '* Global Fields '*------------------------------------------------------------- '* Array Specs '*------------------------------------------------------------- '* Constants '*------------------------------------------------------------ '* Named Indicator D indptr s * inz(%addr(*In)) D dsind ds based(indptr) D pagedown n overlay(dsind:16) D FilterChange n overlay(dsind:60) D sfl10dsp n overlay(dsind:75) D sfl10clr n overlay(dsind:76) D sfl10end n overlay(dsind:77) D msgsflend n overlay(dsind:98) D GeneralError n overlay(dsind:99) '*------------------------------------------------------------ '* Variables '*------------------------------------------------------------ * REC10S ------------------------------------------- D #rrn10 s 4s 0 D #trn10 s 4s 0 D #lrn10 s 4s 0 D #prn10 s 4s 0 inz(15) D #hrn10 s 4s 0 '*------------------------------------------------------------ '* Prototypes '*-------------------------------------------------------------------- D dspprogress pr '*-------------------------------------------------------------------- D getest pr 50a D test 1a D length 3p 0 D instring 50a const '*------------------------------------------------------------ D procfunctionkey... D pr D ismatch pr n D flength 10i 0 const D tlength 1a const D scfield 50a const D wrkfield 50a const '*------------------------ D f4list pr D loadsfl10 pr D scsela pr D scseld pr D clrsfl10 pr D bldsfl10 pr D procsfl10 pr D filter10 pr n /EJECT '*------------------------------------------------------------ '* Main Program '*------------------------------------------------------------ /free dou *inkc or *inkl; write rec10c; write rec10ce; read rec10c; select; // Fold Key -------------- when *inkm; sfl10mode = sfl10mode <> '1'; *in10 = sfl10mode; // Pagedown ----------------------- when pagedown; callp bldsfl10(); // Filter Changed ----------------------- when FilterChange; callp clrsfl10(); callp bldsfl10(); // Process Subfile ----------------------- endsl; // ------------------------ enddo; eval *inlr = *on; return; /end-free // ------------------------------------------------------------ C *inzsr begsr /free // ------------------------------------------------------------ // Initialisations // ------------------------------------------------------------ eval qm_msgq = '*'; // callp SetDftPgmq(PIPrc); callp clrsfl10(); callp bldsfl10(); /end-free C endsr /eject P clrsfl10 b '*------------------------------------------------------------ /free eval sfl10clr= *on; write rec10c; eval sfl10clr= *off; eval #rrn10 = *zero; eval #trn10 = *zero; eval #lrn10 = *zero; // ---------------------------------------------------------- /end-free P clrsfl10 e /eject '*------------------------------------------------------------ P bldsfl10 b '*------------------------------------------------------------ /free eval #rrn10 = #lrn10; eval #hrn10 = *zero; dou #hrn10 >= #prn10; eval #rrn10 = #rrn10 + 1; eval #hrn10 = #hrn10 + 1; write rec10s; enddo; eval sfl10dsp = #rrn10 > *zero; eval sfl10end = *on; if sfl10dsp; if #rrn10 > #lrn10; eval #trn10 = #lrn10 + 1; eval #lrn10 = #rrn10; eval #rrn10 = #trn10; endif; else; //callp sndmsg('CPD0006':' No Items found'); endif; /end-free P bldsfl10 e /eject '*-------------------------------------------------------------------- P f4list b /free // callp sndmsg('CPD0006':' Record: ' + #record // + ' Field: ' + #field // + ' Position: ' + %char(#position)); /end-free P f4list e I found no way to disable the CF14. You need *IN10 to control the FOLD/UNFOLD so it won't disable based on indicators. Maybe someone else has an idea. Otherwise, you are going to have to hide CF14 somewhere. Marvin Radding -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Booth Martin Sent: Monday, October 24, 2005 2:55 PM To: RPG programming on the AS400 / iSeries Subject: RE: subfile SFLFOLD/SFLDROP and cursor positioning Marvin, you are where I started from. I'm betting that if you experimented a bit you would be as surprised as I was. Pressing F14 does not return the program to the C-Specs. If you put a debug breakpoint on the line after the exfmt, you will not see the program source when you press F14 or the page down & page up keys. As to setting the fold/unfold indicator, it really is just a matter of eval-ing the indicator to equal theSFLMODE() keyword. Its just one line in the program, and there is nothing more needed. Not even at *inzsr time. Its a matter of taking out superfluous lines, not adding them; at least so far that appears to be the case. --------------------------------- Booth Martin http://www.martinvt.com --------------------------------- -------Original Message------- From: RPG programming on the AS400 / iSeries Date: 10/24/05 16:35:36 To: RPG programming on the AS400 / iSeries Subject: RE: subfile SFLFOLD/SFLDROP and cursor positioning First, you could use F14 to change the fold/unfold in conjunction with the SFLDROP/SFLFOLD and the SFLMODE keys words. A little more programming but it will work. I use them to keep the fold/unfold consistent between enter keys. Second, you would have to, as Matt Tyler suggested, use the INFDS for the display file to find out where the cursor is, and by calculation, determine which record it is on. But as I pointed out, it could get a little hairy is you move the current subfile record to the top of the subfile area. If you keep it consistent by not putting *TOP on the SFLRCDNBR, then it is possible. Marvin -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. .
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.