Posted: Thu Nov 23, 2006 4:29 am Post subject: Referencing non-data lines - ZSCREENI ?
Hi,
I did see one of the posts here where it says that it is difficult to reference the non-data lines using a macro. I have tried to address this problem using ZSCREENI dialog variable; but has hit with some glitches. I hope that somebody here will be able to help me out. My query is as below:
I have an ISPF Edit macro that uses REXX and here I need to process the NOTELINE-s returned by an Edit command. As I cannot directly read the contents of the NOTELINE, I use the ZSCREENI variable of the ISPF shared variable pool to capture the screen image and extract the required lines. The Edit command is a user-defined command and is invoked from inside my macro. (code pasted below) Pls note here that I do not have authority to change how the command operates; I can merely use it in my macro.
Here, the problem I'm facing is that: The dialog variable ZSCREENI doesn't refresh its contents after I run the Edit Command that generates the NOTELINE-s; the variable still returns the screen image where I had invoked the macro at the command line, ie without any special nondata lines in display. I would like to know how I can refresh the contents of ZSCREENI with the latest screen image, and I want that done from inside my macro. I have tried different methods but I couldn't find a way to get the latest screen image into ZSCREENI.
I'm attaching the gist of problem code here:
Code:
ADDRESS ISREDIT "JEMCHK" --> this is the Edit command that generates the NOTELINE-s in Edit window
ADDRESS ISPEXEC "VGET (ZSCREENI)"
<process lines>
ADDRESS ISREDIT "DOWN PAGE"
ADDRESS ISPEXEC "VGET (ZSCREENI)"
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
Posted: Thu Nov 23, 2006 1:00 pm Post subject:
Quote:
The dialog variable ZSCREENI doesn't refresh its contents after I run the Edit Command that generates the NOTELINE-s
That is how it works. ZSCREENI is a copy of the screen image that was displayed by the last display operation. Within an edit macro, you can not drive the editor's display function. There is no way to get that the off-screen non-data lines from within an edit macro using documented 'interfaces.
Update: It may be possible after all... You might be able to take advantage of the ISREMSPY program to drive a fake edit screen and capture that.
Code:
/* REXX - get all note lines from an edit macro */
Address isredit
'MACRO'
Do a = 1 to 50
line = 'this is note line #' 51-a
'LINE_AFTER .ZF = NOTELINE (line)'
End
Do a = a to 100
line = 'this is note line # 'a
'LINE_BEFORE .ZL = NOTELINE (line)'
End
/* now capture the lines that were added */
Address ispexec 'VGET (ZSCREENW,ZSCREEND)'
'(US) = USER_STATE'
'UP MAX'
Do 9 Until lastpage
Address ispexec 'CONTROL NONDISPL END'
Address tso 'ISREMSPY'
Address ispexec 'VGET ZSCREENI'
lastpage= pos('Bottom'||' of Data',zscreeni) >0
Do While zscreeni <> ''
line=substr(zscreeni,1,zscreenw)
zscreeni=delstr(zscreeni,1,zscreenw)
If substr(line,2,6)='=NOTE=' Then
Say delstr(line,1,8)
End
'DOWN' zscreend-4
End
'USER_STATE = (US)'
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum