home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / xc212os2.zip / DEF / formstr.def < prev    next >
Text File  |  1995-04-14  |  2KB  |  70 lines

  1. (* Copyright (c) xTech 1992,95. All Rights Reserved *)
  2. <*+ m2extensions *>
  3. DEFINITION MODULE FormStr;
  4.  
  5. IMPORT  SYSTEM;
  6.  
  7. PROCEDURE print (VAR str: ARRAY OF CHAR;
  8.                      fmt: ARRAY OF CHAR;
  9.                  SEQ arg: SYSTEM.BYTE);
  10.  
  11. PROCEDURE append(VAR str: ARRAY OF CHAR;
  12.                      fmt: ARRAY OF CHAR;
  13.                  SEQ arg: SYSTEM.BYTE);
  14.  
  15. PROCEDURE image (VAR str: ARRAY OF CHAR;
  16.                  VAR pos: CARDINAL;
  17.                      fmt: ARRAY OF CHAR;
  18.                  SEQ arg: SYSTEM.BYTE);
  19.  
  20. PROCEDURE iscan(VAR num : INTEGER;
  21.                     str : ARRAY OF CHAR;
  22.                 VAR pos : CARDINAL;
  23.                 VAR done: BOOLEAN);
  24.  
  25. (***************************************************************
  26.  
  27.                       FORMATTED OUTPUT TO STRINGS
  28.  
  29. PROCEDURE print
  30. ---------------
  31.      Forms the string, defined by (format,args) pair.
  32.  
  33. PROCEDURE append
  34. ----------------
  35.      Appends the string, defined by (format,args) to the string -str-,
  36. starting from LENGTH(str) position.
  37.  
  38. PROCEDURE image
  39. ---------------
  40.      Appends the string, defined by (format,args) to the string -str-,
  41. starting from position -pos-. After call -pos- points to the end of new
  42. string ( str[pos]=0C OR pos>HIGH(str) )
  43.  
  44. PROCEDURE iscan(
  45. ----------------
  46.                 VAR num : INTEGER;
  47.                     str : ARRAY OF CHAR;
  48.                 VAR pos : INTEGER;
  49.                 VAR done: BOOLEAN);
  50.  
  51.      Reads an integer number from -str- starting from position -pos-.
  52. Skips spaces if necessary. After call:
  53.  
  54.         done  -- = TRUE, if number is read successfully;
  55.         pos   -- index of symbol immediately following the number;
  56.         num   -- contains the number read, if -done-.
  57.  
  58.      Number can be represented in any form acceptable in Modula-2:
  59.  
  60.         123456789
  61.        -1
  62.         0ABCDEFh
  63.         177b
  64.        -177b
  65.         377c
  66.  
  67. ***************************************************************)
  68.  
  69. END FormStr.
  70.