home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a075 / 1.img / TOOLKIT1.EXE / SST41.PRG < prev    next >
Encoding:
Text File  |  1989-08-08  |  1.4 KB  |  57 lines

  1. ********************
  2.  
  3. FUNCTION Mustfill
  4.  
  5.    PARAMETERS _mustfa, _mustfb, _mustfc, _mustfd, _mustfe
  6.  
  7.    * To tell the end user that the field/variable MUST
  8.    * be filled.  The screen position, if not said, will be
  9.    * one column over from the last known screen column
  10.    * position, the row position will default to the same, no
  11.    * tone will sound and the say "This field MUST be filled!"
  12.    * will be echoed.
  13.  
  14.    IF EMPTY(PCOUNT())
  15.       RETURN(.F.)
  16.    ELSEIF PCOUNT() = 1
  17.       _mustfb = ROW()
  18.       _mustfc = COL()+1
  19.       _mustfd = "This field MUST be filled"
  20.       _mustfe = .F.
  21.    ELSEIF PCOUNT() = 2
  22.       _mustfc = COL()+1
  23.       _mustfd = "This field MUST be filled"
  24.       _mustfe = .F.
  25.    ELSEIF PCOUNT() = 3
  26.       _mustfd = "This field MUST be filled"
  27.       _mustfe = .F.
  28.    ELSEIF PCOUNT() = 4
  29.       _mustfe = .F.
  30.    ENDIF
  31.  
  32.    PRIVATE _mustcol
  33.  
  34.    _mustcol = SETCOLOR()
  35.  
  36.    IF LASTKEY() = 5 .OR. !EMPTY(_mustfa)
  37.       IF !EMPTY(_mustfd)
  38.          SETCOLOR(Set_color(Attribute(_mustfb, _mustfc)))
  39.          @ _mustfb, _mustfc SAY SPACE(LEN(_mustfd))
  40.          SETCOLOR(_mustcol)
  41.       ENDIF
  42.       RETURN(.T.)
  43.    ELSE
  44.       IF _mustfe
  45.          TONE(168.00, 4)
  46.          TONE(140,00, 1)
  47.       ENDIF
  48.       IF !EMPTY(_mustfd)
  49.          SETCOLOR(Set_color(Attribute(_mustfb, _mustfc)))
  50.          @ _mustfb, _mustfc SAY _mustfd
  51.          SETCOLOR(_mustcol)
  52.       ENDIF
  53.       RETURN(.F.)
  54.    ENDIF
  55.  
  56. * End of File
  57.