Newsgroups: vmsnet.tpu
Subject: Thanks RE: NOTES$COMMAND.TPU ???, but...
From: "J.Lance Wilkinson, 814-865-1818" <jlw%psulias.bitnet@shsu.edu>
Date: Tue, 29 Sep 1992 16:48 EST
Reply-To: "J.Lance Wilkinson, 814-865-1818" <JLW%PSULIAS.BITNET@SHSU.edu>
Organization: The Internet
Return-Path: <TPU-Mgr@SHSU.edu>
Errors-To: TPU-Mgr@SHSU.edu
X-Listname: Text Processing Utility (TPU) Language Discussion List
CC: INFO-TPU@SHSU.edu
X-Organization: Penn State University / University Libraries
X-Envelope-To: INFO-TPU@SHSU.BITNET
X-Vms-To: IN%"carl@SOL1.GPS.CALTECH.EDU"
X-Vms-Cc: in%"INFO-TPU@SHSU"

Thanks to Carl Lydick, the first one to point me to the right page in the grey
wall for the TPU builtin "FILE_SEARCH()".

However, I'm still having trouble, probably for all the bells-n-whistles I
guess I'm trying along with FILE_SEARCH().  Maybe I should have just left well
enough alone, but....

I incorporated FILE_SEARCH(), and some other manipulations involving only my
local variables, I thought, and all of those variables are string variables.
However, I got some errors so I added SET(TRACEBACK,ON) and SET(LINE_NUMBER,ON)
to try and debug the problem.  Unfortunately, the only line number it gives me
within my LOCAL_EXTRACT procedure is the last line.  It keeps complaining
about, I think, a string assignment I'm making in a loop, immediately after
I've used FILE_SEARCH and determined that it has *NOT* returned a null string.
Something about STRING + Integer not being supported.  Here's the procedure;
any suggestions?

! Extract a (range of) notes to file

procedure local_extract
  local print_range;
  local extract_file;
  local test;
  local test_file;

  set (traceback,on);
  set (line_number,on);

if notes$x_notefile_ctx = "" then
  message ("You are not currently in a conference");
  return;
endif;

print_range := read_line("Enter range of notes to extract: ");

if length(print_range) = 0
  then
    if last_key = ctrl_z_key
      then
        return
      else
        print_range := "."
    endif
endif;
loop
  extract_file := read_line("Enter filename for extraction: ");
  if length(extract_file) = 0
    then
      if last_key = ctrl_z_key
        then
          return
        else
          extract_file := "sys$login:notes_extract.tmp"
      endif
  endif;

  test_file := file_search(extract_file);
  exitif test_file = "";
  loop
    test := read_line(extract_file + " exists.  Append/Replace/Change? ");
    if length(test) = 0
      then
        if last_key = ctrl_z_key
          then
            return
          else
            test := "eh?"
        endif
    endif;
    change_case(test,UPPER);
    case substr(test,1,1)
           ["A"] : test := "/append";
           ["R"] : test := "";
           ["C"] : test := "loop";
      [OUTRANGE] : test := "eh?";
    endcase;
    exitif test <> "eh?";
  endloop;
  exitif test <> "loop";
endloop;

message ("Extracting to file " + extract_file + "...");
update(ALL);
message("extract" + test + " " + extract_file + " " + print_range
update(ALL);
endprocedure

+-"Never Underestimate the bandwidth of a station wagon full of mag tapes"--+
| J.Lance Wilkinson ("Lance")            BitNet:    JLW@PSULIAS.BITNET      |
| Systems Design Specialist - Lead       InterNet:  JLW@PSULIAS.PSU.EDU     |
| Library Computing Services             AT&T:      (814) 865-1818          |
| E8 Pattee Library                      "I'd rather be dancing..."         |
| Penn State University         A host is a host from coast to coast,       |
| University Park, PA 16802     And no one will talk to a host that's close |
| <POSTMAST@PSULIAS.BITNET>     Unless the host that isn't close            |
| <POSTMAST@PSUCES.BITNET>      Is busy, hung or dead.                      |
+------"He's dead, Jim. I'll get his tricorder. You take his wallet."-------+