home *** CD-ROM | disk | FTP | other *** search
- MODULE Test;
-
- IMPORT In,Out,stu:=StringUtils;
-
- PROCEDURE ProgMain*;
- VAR
- chPtr : chP;
- intPtr : stu.intP;
- strPtr : stu.strP;
- arr : stu.arr10T;
- s : STRING50;
- i : INTEGER;
- BEGIN
- (* create and init some records *)
- NEW(chPtr);
- NEW(intPtr);
- NEW(strPtr);
- chPtr.datatype := 'char';
- chPtr^.c := 'X'; (* ^ here is optional *)
- intPtr.datatype := 'integer';
- intPtr.i := 100;
- strPtr.datatype := 'string';
- strPtr.s := 'Hello there, folks!';
-
- (* create a format string, s *)
- s := '% "%" is worth ú%!';
- Out.String( 'Before processing, the string is: ' );
- Out.String( s );
- Out.Ln;
-
- (* init the array, arr, by filling the slots with NILs *)
- FOR i := 0 TO LEN(arr)-1 DO
- arr[i] := NIL;
- END;
-
- arr[0] := strPtr;
- arr[1] := chPtr;
- arr[2] := intPtr;
- stu.ProcessArray( s, arr );
- Out.Ln;
- Out.String( 'After processing, the string is: ' );
- Out.String( s );
-
- END ProgMain;
-
-
- END Test.
-