home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / new / biz / dbase / afile / example / disks.mask < prev    next >
Text File  |  1994-07-27  |  1KB  |  59 lines

  1. /*
  2.  * This is a sample input mask for AFile
  3.  * It demonstrates the $MASK, $MENU, $PRINT and $PRINTFMT specifications
  4.  *
  5.  * $MASK    Disks.pic
  6.  **    Field        XPos    YPos    Width    AREXX?    Message
  7.  *    ARTIST        250    39    -    -    Artist or band
  8.  *    ALBUM        250    49    -    -    Album's name
  9.  *    YEAR        325    59    -    CHECK    Released year (with century)
  10.  *    DURATION    204    89    -    -    Duration in minutes
  11.  *    PURCHASE    326    145    -    CHECK    Purchase date
  12.  *    CD        326    155    -    -    Set for CD, cleared for K7
  13.  *    STYLE        266    114    -    -    Kind of music
  14.  * $END
  15.  *
  16.  * $MENU
  17.  **    Item    Args?    Script
  18.  *    Stats    -    DisksStats.rexx
  19.  * $END
  20.  *
  21.  * $PRINT    DisksPrint.rexx
  22.  *
  23.  * The above print script produce the same output that the following specification:
  24.  ** $PRINTFMT %1, %2 (%3)\n
  25.  * Try both of them (not at the same time, as told in the doc !)
  26.  */
  27.  
  28. OPTIONS RESULTS
  29. PARSE ARG Field Value
  30. Value = STRIP( Value )
  31.  
  32. SAY Field
  33. SAY Value
  34.  
  35. /*
  36.  * Verifies that YEAR is in the YYYY format
  37.  */
  38.  
  39. IF Field = 'YEAR' THEN DO
  40.     IF LENGTH( Value ) = 4 THEN EXIT 0
  41.     EXIT 10
  42.     END
  43.  
  44. /*
  45.  * Verifies that PURCHASE date is at least greater than released YEAR
  46.  * We get PURCHASE value in the YYYYDDMM format
  47.  * The YEAR field is in the YYYY format
  48.  */
  49.  
  50. IF Field = 'PURCHASE' THEN DO
  51.     ADDRESS "AFile_rexx"
  52.     "GETFIELD YEAR"
  53.     IF RESULT <= LEFT( Value , 4 ) THEN EXIT 0
  54.     EXIT 10
  55.     END
  56.  
  57. EXIT 10
  58.  
  59.