Example Using the POSITN Function

Product Version(s): 3.13 3.20 3.3x
Operating System:   MS-DOS
Flags: ENDUSER | TAR21065
Last Modified: 30-SEP-1988    ArticleIdent: Q10853

Question:

I am trying to use the POSITN procedure without success. Could you
give me an example that uses POSITN?

Response:

POSITN is an intrinsic function.

The following example program demonstrates the use of the POSITN
function:

   program position_ex(output);
   VAR     I        : integer;
           PAT      : string(3);
           S        : string(7);
           position : INTEGER;
   begin
      PAT:='pat';
      S:= 'pattern';
      I:= 1;
      position :=POSITN(PAT,S,I);
      WRITELN('POSITION=',position);
   end.

The output was:    POSITION=             1
