Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!munnari!murdu!u3369429
From: u3369429@murdu.OZ (Michael Bednarek)
Newsgroups: comp.os.vms
Subject: A TPU question (MATCH)
Message-ID: <1276@murdu.OZ>
Date: Fri, 17-Jul-87 03:09:54 EDT
Article-I.D.: murdu.1276
Posted: Fri Jul 17 03:09:54 1987
Date-Received: Sat, 18-Jul-87 13:52:52 EDT
Followup-To: comp.os.vms
Distribution: world
Organization: I.A.E.S.R., Melbourne University
Lines: 45
Keywords: TPU edit match


After two days of try/error I would like to ask the net:

Using TPU (under VMS 4.5), does anybody know how to search for a TAB
within the current line?

Here is what I tried so far:

Procedure Check_Tabs
 On_Error
  Return;
 EndOn_Error
! The next 2 statements produce a syntax error. Why?
!s:=Search(ASCII(9) & Match(ASCII(13)),Forward);
!t:=ASCII(9) & Match(ASCII(13));
!s:=Search(t,Forward);
! So I had to settle for:
 TAB:=ASCII(9);
 CR:=ASCII(13);
 t:=TAB & Match(CR);
 s:=Search(t,Forward);	! Never finds it. Exit due to Error-trap.
 If s=0 then Return; Endif;
 Position(s);
EndProcedure;

I'm a bit confused by the various TPU data types. I would like to do:
s:=Search(ASCII(9) & Match(Line_End),Forward);
but Line_End returns a pattern, whereas Match requires a string.

I want to avoid to move through the whole buffer and look at every character
(Is_Tab:=Current_Character=ASCII(9);) when most of the characters are not TABs.

It seems that none of the SYS$LIBRARY:*.TPU files ever uses MATCH.
Is that significant? Is MATCH broken?

Can anyone help?

Michael Bednarek		u3369429@{murdu.oz.au | ucsvc.dn.mu.oz.au}
Institute of Applied Economic   ...{seismo.CSS.GOV | UUNET.UU.NET}!munnari!
  and Social Research (IAESR)	   {murdu.oz | ucsvc.dn.mu.oz}!u3369429
Melbourne University		mb@munnari.oz.au
Parkville 3052, Phone : +61 3 344 5744
AUSTRALIA

"POST NO BILLS."