Joined: 07 Feb 2009 Posts: 1102 Location: Oostende, Belgium
At my current employer the final qualifier of datasets is either SAM or PDS, to designate sequential datasets and PDS'es. As a consequence every FB 80 PDS uses the same edit profile, which is not very useful with regard to the setting of tabs, bounds and hilighting.
To stop me getting mad, I've written an initial macro to more-or-less mimics the auto-language selection, as used by the HI command, to determine the language and set the profile accordingly, and that's where I've run into a problem with the 'USER_STATE'.
If I'm in a memberlist, edit or view a member, do a "f 'whatever'", leave, select another member, and do an RFIND, it will again try to find 'whatever'. However, if I do the same thing from the main Edit or View panel, the RFIND will go for either 'dcl' or ' then ', the two keywords I use to detect PL/I, DESPITE the fact that the two find's are bracketed by a save and restore of the USER_STATE. Stranger yet, while tracing the initial macro, USER_STATE does NOT contain 'whatever'. If I disable the initial macro, do a find 'whatever' in mem1, and follow that by an RFIND in mem42, 'whatever' is found, but again it is NOT in the USER_STATE.
Even stranger is this behaviour, with the initial macro disabled, so anyone should be able to repeat:
1) edit/view a member or dataset
2) f 'a string like lalala'
3) run the macro below
/* REXX */
"isredit (S) = user_state"
and somewhere your screen you'll see 'A STRING LIKE LALALA'
4) edit/view an non-existing (new) member
5) run the macro and see anything, EXCEPT 'A STRING LIKE LALALA'
6) do an argumentless RFIND
7) run the macro, and miraculously, 'A STRING LIKE LALALA' is back.
Where did ISPF get it from, and how do I get at it to stop my initial macro from screwing up the find string.
state = overlay(flc, state, 51)
state = overlay(clc, state, 59)
state = overlay(fs, state, 225)
state = overlay(cs, state, 481)
state = overlay(fcx, state, 43)
state = overlay(ftx, state, 44)
state = overlay(zf, state, 209)
state = overlay(zl, state, 217)
state = overlay(xnx, state, 73)
state = overlay(afln, state, 65)
state = overlay(ps, state, 63)
"isredit user_state = (STATE)"
The 'afln' string is OK, but it seems to need more info to actually make the Find/Change/Exclude work as expected, left up to the user to figure that out.