home *** CD-ROM | disk | FTP | other *** search
- PROGRAM STRINGS; {a demo of the built-in string operations}
- VAR
- S1:STRING;
- S2:STRING;
- POSN:INTEGER;
-
- BEGIN
- CURSOR(0,0);
- WRITELN('strings demo program');
- REPEAT
- WRITE('enter string 1: ');
- READLN(S1);
- WRITE('enter pos: ');
- READLN(POSN);
- WRITE('enter string to insert: ');
- READLN(S2);
- WRITELN(S1,'-',POSN:1,'-',S2);
- INSERT(S1,POSN,S2); {insert S2 in S1 starting at S1[POSN] }
- WRITELN('S1 =',S1,'.');
- UNTIL S1 = 'stop';
- END.