Question

  Asked: Apr 7 2008   12:31 AM GMT
  Asked by: It doubts


how can we use ponter in function keys?


RPGLE, iSeries development

usually we are using
if *in03=*off like that instead of this i want to give directly
IF EXIT like that I think some pointers are used to this i am not sure about that please replay me this question.

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



In order to assign Function Keys F1-F24 to Names/Pointers use the INDARA in the Dispaly File see the example here:
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/rzakc/rzakcmstdfindar.htm


Then use the INDDS keyword in your RPG program
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/rzakc/rzakcmstdfindar.htm


FZZDR917D CF E WORKSTN
F INDDS(SRIND)


Define the datastructure in the RPG program:

D SRIND DS
D*
D* -- Display File Command Key Indi
D EXIT 3 3N
D PROMPT 4 4N
D DELETE 11 11N
D CANCEL 12 12N


Then use the names in your in the RPG program:

DOU EXIT = *ON;
|
ENDDO;
or
IF PROMPT = *ON;
or
IF DELETE = *ON;
or
IF EXIT = *ON OR CANCEL = *ON;
EVAL EXIT = *ON;
LEAVESR;
ENDIF;


------------------------------------------------------

An excellent response. As the original question had to do with using 'IF EXIT' I'll just point out that the above examples could just as easily have used 'IF EXIT' and 'IF NOT EXIT' rather than '= *ON' as the fields are defined as indicator fields.

Bruce Vining
  • AddThis Social Bookmark Button

Browse more Questions and Answers on AS/400.

Looking for relevant AS/400 Whitepapers? Visit the Search400.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

Sloopy  |   Apr 14 2008  1:56PM GMT

Here, we don’t use indicators with function keys. This frees up 24 indicators. However, in ILE programming we shouldn’t be using many indicators anyway!

If anyone is interested in indicator-less function keys, let me know and I’ll publish the code. I do believe that it’s pretty common knowledge, anyway - and I would bet that Bruce probably does it better!

Regards,

Sloopy

 

Bvining  |   Apr 14 2008  2:46PM GMT

I don’t know about better or worse, but I agree with you — I don’t use indicators for function keys either :)

 

NarasimhaReddy  |   Apr 16 2008  5:02AM GMT

If you are using COBOL, Conditional names can be used to use Indicators in a better way while using seperate indicator area.