I wrote a wrapper for the ED command last week to keep an audit trail of any changes made to files outside our applications. I'm just writing a before and after version of an edited record to a temp file and comparing afterwards. All seemed fine until one of my coworkers informed me he could no longer use "X" to drop back to TCL after editing from a select list. This was due to the fact that I was processing the select list in the wrapper program and just executing ED once for each record. For "X" to work as it used to, I need to write out all the selected records at the beginning, let ED process the select list, then go back through the list again for comparison.

Here's the problem:
No matter what I do, I can't get ED to recognize an active select list that is activated within the wrapper program. I use "READLIST ITEMS" at the beginning to get the list of items to write to the temp file, then "SELECTN ITEMS TO 0" prior to executing ED. I also tried writing the list to &SAVEDLISTS& and executing "GET.LIST ":TEMP.LIST prior to executing ED, but got the same result. These two test programs illustrate the problem:


BP TEST.READLIST
0001: READLIST ITEMS ELSE ITEMS = ''
0002: PRINT 'CONTENTS OF ITEMS=':ITEMS
0003: SELECTN ITEMS TO 0
0004: EXECUTE 'RUN BP TEST.READLIST2'
0005: LOOP
0006:   READNEXT ITEM ELSE EXIT
0007:   PRINT 'READNEXT ITEM=':ITEM
0008: REPEAT
0009: END

BP TEST.READLIST2
0001: READLIST ITEMS ELSE ITEMS = ''
0002: PRINT 'CONTENTS OF ITEMS=':ITEMS
0003: END

Output:
>SELECT BP SAMPLE 10

10 record(s) selected to SELECT list #0.
>>RUN BP TEST.READLIST
CONTENTS OF ITEMS=1 2 3 4 5 DD FF MCT1 T2
CONTENTS OF ITEMS=
READNEXT ITEM=1
READNEXT ITEM=2
READNEXT ITEM=3
READNEXT ITEM=4
READNEXT ITEM=5
READNEXT ITEM=DD
READNEXT ITEM=FF
READNEXT ITEM=MC
READNEXT ITEM=T1
READNEXT ITEM=T2

Clearly the select list is activated by SELECTN because the subsequent READNEXT works, but the executed program can't see an active select list. Is there any way around this? I'd hate to have to make a modified copy of the UV ED command, but that's the only alternative I see at this point.

TIA,
John

--
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users

Reply via email to