[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: ex1 vs. ex



Reply to note from Harry Binswanger  Sun, 14 Nov
2004 23:25:05 -0500

Harry:

> wouldn't CLEARSGTS take care of that? I could (manually) do
> CLEARSGTS 555 - 559.

Yeah, yeah, but that's a pain. The point is to write code that
avoids the need for manual cleanup. Because chances are, Harry,
you're not going to clear anything manually. The answer is simple.
Add CLEARSGTS to your code: JM 2.clearsgtsQ2 .

> I have a couple of calls like jm 2.CHR$ q2 and jm 2.PUTCR q2.
> Wouldn't those terminate immediately? I assume they are called,
> do their thing, and are done before I get to the next thing in
> my XPL code. No es verdad?

True, true. The U2 frames will clean up after themselves even if
you call them in a subroutine and EX1 out of it. So, actually,
calling Jumbo U2 frames is not a problem. You still need to ensure
that your sub EXits tidily, though -- i.e., clears values out of any
"permanent" S/Gs that were used. (Obviously if you can avoid using
permanent S/Gs in the first place, by all means do.)

> But are you talking about S/G ranges outside the 600-799? I use
> a lot of S/Gs below 50 (50 is of course reserved for U2), and
> sometimes in 51 - 99. Hmmm maybe this accounts for some
> intermittent problems I've had using PUTCR and UNPUTCR in my
> programs.

Different issue: Save/Get conflicts. Of course, we use S/Gs outside
of 600-799! Most of our PMs are located in 01-99. And of course
you have to deal with S/G conflicts when you call a U2 routine or
RUN a PM as a subroutine. U2 has powerful tools to manage
conflicts. They're called HIDE and UNHIDE. Check 'em out.

S/G 50, by the way, is not reserved for U2. You can use it in your
personal programming, but you'll have to hand off or HIDE its
contents if your PM calls a U2 frame that expects an arg. In other
words, you'd do JM 2.HIDE:50Q2 JM 2.framenameQ2 , then
JM 2.UNHIDEQ2 to restore the original value to S/G 50 after the U2
frame terminates. The same goes for other S/Gs. If your PM is
using 01-04 and you want to call PUTCR, which uses 01-06, you need
to do JM 2.HIDE:01-04Q2 JM 2.putcrQ2 JM 2.UNHIDEQ2 . Like I said,
check out HIDE and UNHIDE. Important tools if you want to do
structured XPL.

> I use JM for U2 frames, but can I and should I be using JM
> instead of RUN here?

You could, if you imported your RUN-style PM into U2. Use whatever
fits the situation.

> I've gotten the (seemingly self-evident) idea of having the
> parent program not merely report the error code on its command
> line, but open up a new window with space for a more complete
> error report, including longer text messages and giving the
> present value of several S/Gs.

You mean you've discovered XRAY? It's only been around a dozen
years or so....

--
Carl Distefano
cld@xxxxxxxx