View previous topic :: View next topic
|
Author |
Message |
joejacob
New User
Joined: 21 Jun 2007 Posts: 14 Location: India
|
|
|
|
I need to develop a tool to search for a particular working storage variable in a member of PDS.
When the cursor is placed on the working storage variable to be searched and the user presses a PF key say F4 the the cursor should go to the declaration of the working storage variable and when the user presses the same key again the cursor should go to the subsequent occurrence of the same variable. Finally when the user presses another PF key the cursor should go to the initial position.
This is similar to the search for a word conducted in an editor. But in this case the program should read the working storage variable from the cursor position instead of giving the string to be searched as an input. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
Why would you want to do this when TSO Browse/Edit/View already provides FIND and RFIND which give this sort of functionality?
This looks like homework ?
Garry. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
I would suggest an ISPF edit macro for this case.
O. |
|
Back to top |
|
|
joejacob
New User
Joined: 21 Jun 2007 Posts: 14 Location: India
|
|
|
|
I need to develop this because in find user has to type the variable to be searched in the command section and press F5 instead I need to search the variable by placing the cursor under it and just press the PF key so tht it becomes more easier.
I'm new to REXX so please explain the commands that can be used for this. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
Quote: |
instead I need to search the variable by placing the cursor under it and just press the PF key so tht it becomes more easier. |
So, under your scenario, the user has to read through the text until they see the exact string they want - possibly several pages down, THEN position the cursor on it and THEN start the PF key searching?? This hardly seems
ofer71's suggestion of using an ISPF Edit Macro would probably suit, but you still have to get the user to initiate this someway.
Garry |
|
Back to top |
|
|
joejacob
New User
Joined: 21 Jun 2007 Posts: 14 Location: India
|
|
|
|
I need this tool particularly for debugging purpose suppose if he come across a variable and he needs to see its declaration and picture clause on a key press the cursor has to go to the declaration. This and on subsequent presses it should go to the next occurrence.
Can you explain how ISPF Edit Macro works? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Quote: |
I needthis tool particularly for debugging purpose suppose if he come across a variable and he needs to see |
It is not clear if you need or he needs... however I sort of see the benefit.
Study the ISPF Edit manual. I suggest to use:
1. CURSOR macro instruction to determine line and column of cursor location.
2. LINE macro instruction to get the data into rexx variable
3. UP MAX macro instruction
4. EXCLUDE ALL to hide all lines
5. Use the FIND ALL macro instruction to find occurrences of the search text.
The cursor should be at the first instance, which frequently is the variable declaration. Use F5 to move cursor to next instance of the variable.
Use RESET command to show other lines. |
|
Back to top |
|
|
|