/* REXX ------------------------------------------------------------- */ /* Name: FSCREEN */ /* Short: Find chars an the screen */ /* Type: REXX-Exec */ /* Author: Norbert Haas */ /* Syntax: TSO %FSCREEN string */ /* Requiers: Function NOT() */ /* Remark: Contains two undocumented ISPF-Vars */ /* 1) zscreeni = The whole content of the screen, beginning from the */ /* upper left corner to the lower right corner. */ /* 2) zscreenc = The cursor position as number between 0 and max, */ /* where max is lines * columns - 1. */ /* zscreenw = Screen width (i.E. 80, 132 depending on logmode) */ /* */ /* Version Author Date Why */ /* ------- ------------- ---------- --------------------------------- */ /* V01.00 N.Haas 06.06.2003 Creation */ /* ------------------------------------------------------------------ */ /* Fetch string */ PARSE ARG string /* Init */ zedsmsg = '' zedlmsg = '' TRUE = 1 FALSE = 0 found = FALSE /* Fetch screen, cursorposition and screenwidth */ "ISPEXEC VGET (zscreeni,zscreenc,zscreenw)" /* Find the first string */ p = POS(string, zscreeni) IF p > 0 THEN DO DO WHILE p > 0 IF p + LENGTH(string) - 1 = zscreenc THEN NOP ELSE DO row = TRUNC(p / zscreenw) col = p - (row * zscreenw) IF zedlmsg = '' THEN DO zedlmsg = 'String found in (row,col):' found = TRUE END zedlmsg = zedlmsg '('row + 1','col')' END /* Find the next string */ p = POS(string, zscreeni, p + 1) END END IF NOT(found) THEN DO zedlmsg = 'String not found.' END "ISPEXEC SETMSG MSG(isrz000)" EXIT