[comp.os.vms] TPU

NEWCOMER_D@DICKINSN.BITNET ("Newcomer, Don") (09/21/87)

------------------------------ Begin Reference ------------------------------
Date: Sat, 19 Sep 87 3:35 cdt
Received: From PSUVM(MAILER) by DICKINSN with RSCS id 7605
          for NEWCOMER_D@DICKINSN; Sun, 20 Sep 87 06:35 EST
          by PSUVM (Mailer X1.24) id 7583; Sun, 20 Sep 87 06:32:16 EDT
Reply-to: INFO-VAX@KL.SRI.COM
Sender: INFO-VAX Discussion <INFO-VAX@VTVM2.BITNET>
From: Ken Selvia 409-294-1853 <UCS_KAS@SHSU.BITNET>
Subject: TPU
To: DON NEWCOMER <NEWCOMER@DICKINSN>

Hello netlanders. I have become the local TPU expert and while working with it
I have discovered a few "bugs?". Do any of you TPU wizards have any ideas or
comments about the errors in the following TPU procedures?

! (1)
!Try compiling (extending) this one. You should get a fatal internal TPU error.
!Any idea why???
!
procedure fatal_err
a_variable := ("1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" |
               "9" | "A" | "B" | "C" | "D" | "E" | "F" | "G");
endprocedure

! (2)
!You can't access a local variable with execute, and on_error is ignored.
!
!XYZ will not be defined and search will result in an error.
!
procedure dummy
on_error endon_error;
local xyz, name;
     xyz := line_end;
     execute("name := search(line_begin & xyz ,forward)");
     position(name);
endprocedure
------------------------------- End Reference -------------------------------

>! (1)
>!Try compiling (extending) this one. You should get a fatal internal TPU error.
>!Any idea why???
>!
>procedure fatal_err
>a_variable := ("1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" |
>               "9" | "A" | "B" | "C" | "D" | "E" | "F" | "G");
>endprocedure

Looks like, for once, this one does indeed deserve an SPR.  If you reduce the
number of arguments from 16 to 15 it compiles.

>! (2)
>!You can't access a local variable with execute, and on_error is ignored.
>!
>!XYZ will not be defined and search will result in an error.
>!
>procedure dummy
>on_error endon_error;
>local xyz, name;
>     xyz := line_end;
>     execute("name := search(line_begin & xyz ,forward)");
>     position(name);
>endprocedure

This makes intuitive sense since an EXECUTE() acts in a similar fashion to a
PROCEDURE statement.  It's been my experience that for an EXECUTE() to share
variables with another procedure both must use global variables.  An ON_ERROR
ON_ERROR statement won't suppress the error message because the "Undefined
procedure" error has the severity ERROR.  ON_ERROR only suppresses WARNING
messages.

There, hope that all makes sense.  After all, this is my first time responding
in Net-land.  I guess all disclaimers apply (especially since no one here uses
TPU but me!).

                                        Don Newcomer

carl@CITHEX.CALTECH.EDU (Carl J Lydick) (06/04/88)

 > Is there a way to pass parameters to TPU (as in P1 and P2 etc..) when
 > it is invoked something like:
 > 
 >  $ edit/tpu/display/section=evesecini/command=domything.tpu banana.txt 123
 > 
 > I want the command file domything.tpu to accept a line number (123) from the
 > command line (instead of TPU prompting for it) and do whatever to it.

No.  The command-line parser won't allow two arguments; it accepts only one, of
type $INPUT_FILE (or something like that).  You COULD get around that problem
by putting a set of quotes around ALL your arguments. i.e.,
  $ edit/tpu/display/section=evesecini/command=domything.tpu "banana.txt 123"
but then the startup procedure in the section file would try to read in
the file "banana.txt 123", and, of course, fail.

What you could do is to write a procedure that overrides the default startup
procedure, compile it, save the result in your own section file, then use:
  $ edit/tpu/display/section=my_evesecini "banana.txt 123"