DataMuseum.dk

Presents historical artifacts from the history of:

RC3500

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RC3500

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦6cdb80867⟧ TextFileVerbose

    Length: 3840 (0xf00)
    Types: TextFileVerbose
    Names: »partwordtxt«

Derivation

└─⟦a41ae585a⟧ Bits:30001842 SW-save af projekt 1000, Alarm-system
    └─⟦72244f0ef⟧ 
        └─⟦this⟧ »partwordtxt« 

TextFileVerbose

job j 1 time 11 0 perm disc1 1000 10
message start compile partword
partword=set 1 disc1
scope user partword
partword=algol
begin
<******************************************************
*
* this program assists in inserting hyphenation characters
* (or partition marks if you will) into long words
* in a textfile.
*
* call:
*  <outfile> = partword in.<infile> max.<maxlength>
*
* default maxlength is 10
* 
* the program must be run online
*
* programmed april 1981 by stb
*
********************************************************>

integer array word(1:100);

integer wordlength,i,max;

boolean finished;

zone zout,zin(128,1,stderror);

real array inname,outname,errorname(1:2);

boolean array test(1:1);


\f


procedure partword;
begin <* writes the word on the screen and reads
partition possibilities *>
integer array word1(1:100);
integer char,i,i1;

outchar(out,'nl');

for i:=1 step 1 until wordlength do outchar(out,word(i));
outchar(out,'nl');
setposition(out,0,0);
i:=1;
i1:=1;

repeat
readchar(in,char);

if char='_' then
begin <* part here *>
word1(i1):='_';
i1:=i1+1;
end;
 
word1(i1):=word(i);

i1:=i1+1;
i:=i+1;
until char='nl';

for i:=i step 1 until wordlength do
begin
word1(i1):=word(i);
i1:=i1+1;
end;

wordlength:=i1-1;

<* now copy the word back to 'word' and check-write it on the screen *>
for i:=1 step 1 until wordlength do
begin
word(i):=word1(i);
outchar(out,word(i));
end;

outchar(out,'nl');
setposition(out,0,0);
end part word;

\f


procedure printword(word,length);
value length; integer length;
integer array word;
begin <* prints the word *>
integer i;

for i:=1 step 1 until length do
outchar(zout,word(i));
end;

\f


procedure readword;
begin <* copies chars until a char with value>=32.
then the word is collected in the word-array *>
integer char,class,i;

repeat
class:=readchar(zin,char);

if char='em' then finished:=true
;
if char<=32 then outchar(zout,char);
until finished or (char>32);

if -, finished then
begin <* collect the word *>
i:=2;
word(1):=char;

repeat
class:=readchar(zin,char);

word(i):=char;
i:=i+1;
until  (char<=32);

repeatchar(zin);
wordlength:=i-2;
end not finished;

end read word;


\f


<*******************  main program  *************************>

finished:=false;
textopen(zout);

getstdfp(outname,inname,errorname,test);
i:=1;
open(zin,4,string inname(increase(i)),0);

max:=l{sfptal(<:max:>);

if max<=0 then max:=10;

write(out,<:
orddelingstegnsinds{ttelseshj{lpeprogram:

N}r programmet skriver et ord, der er for langt, skal du p}
linjen neden under ordet markere orddelingsmulighederne ved
hj{lp af tegnet "_" umiddelbart efter hver orddelingsmulighed.

Fx:
orddelingsmulighed
   _      _
Tast 'SPACE' mellem "_" og 'RETURN' efter den sidste.
:>);
setposition(out,0,0);



repeat
readword;

if wordlength>max then partword;

printword(word,wordlength);
until finished;

textclose(zout,true);
close(zin,true);
end
finis
«eof»