Article View: bit.listserv.simula
Article #605FrontStrip modification
From: Tommy Pollak
Date: Mon, 11 Oct 1993 08:49
Date: Mon, 11 Oct 1993 08:49
28 lines
1656 bytes
1656 bytes
In the swedish book "Objektorienterad programmering och algoritmer i
Simula" by Serafim Dahl and Kjell Lindqvist, Studentlitteratur 1993, a
text procedure to strip the leading blanks of a text is defined.
The procedure will not give correct results for texts with exactly one
non-blank character. Below comes a modified version.
text procedure FrontStrip (t); text t;
begin
t.setpos (1);
while t.more and then t.getchar = ' ' do;
FrontStrip :- if t.more then
t.sub (t.Pos-1, t.length-t.pos+2)
else
! next 3 lines added;
if t.length > 0 then
t.sub (t.Pos-1, t.length-t.pos+2)
else
Notext
end of FrontStrip;
---
Tommy Pollak at ELLEMTEL, department FN, this time not speaking for the
company
Postal address: Box 1505
S-125 05 ALVSJO
Sweden
Phone: +46 8 727 4056 Fax: +46 8 727 41 68
Technical Details
Message-ID:
<1993Oct11.084903.10782@eua.ericsson.se>Path:
arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!pipex!sunic!ericom!eua.ericsson.se!euax1i3c18!euapolShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 113dd9,eeb52afc32f742f5,start X-Google-Attributes: gid113dd9,public X-Google-ArrivalTime: 1993-10-11 03:56:35 PST Newsgroups: bit.listserv.simula Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!pipex!sunic!ericom!eua.ericsson.se!euax1i3c18!euapol From: euapol@eua.ericsson.se (Tommy Pollak) Subject: FrontStrip modification Message-ID: <1993Oct11.084903.10782@eua.ericsson.se> Keywords: FrontStrip text blanks Sender: news@eua.ericsson.se Nntp-Posting-Host: euax1i3c18.eua.ericsson.se Nntp-Posting-User: euapol Reply-To: euapol@eua.ericsson.se Organization: Ellemtel Telecom Systems Labs, Stockholm, Sweden Distribution: swnet Date: Mon, 11 Oct 1993 08:49:03 GMT Lines: 28