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

  1. *******************
  2.  
  3. FUNCTION Wsayget
  4.  
  5.    PARAMETERS _row, _col, _say, _get, _pict, _valid, _withread
  6.  
  7.    IF PCOUNT() = 1
  8.       IF TYPE("_row") = "L"
  9.          scrcursor = .T.
  10.          SET CURSOR ON
  11.          IF _row
  12.             READ
  13.          ELSE
  14.             CLEAR GETS
  15.          ENDIF
  16.          SET CURSOR OFF
  17.          RETURN( IF( (LASTKEY() = 27), .F., UPDATED() ) )
  18.       ENDIF
  19.    ENDIF
  20.  
  21.    IF TYPE("scr_level") != "N"
  22.       scr_level = 0
  23.    ENDIF
  24.  
  25.    IF TYPE("_row") = "L"
  26.       IF TYPE("_col") != "U"
  27.          _row = _col
  28.       ENDIF
  29.       IF TYPE("_say") != "U"
  30.          _col = _say
  31.          _say = ""
  32.       ENDIF
  33.       IF TYPE("_get") != "U"
  34.          _say = _get
  35.          _get = ""
  36.       ENDIF
  37.       IF TYPE("_pict") != "U"
  38.          _get = _pict
  39.          _pict = ""
  40.       ENDIF
  41.       IF TYPE("_valid") != "U"
  42.          _pict = _valid
  43.          _valid = ".T."
  44.       ENDIF
  45.       IF TYPE("_withread") != "U"
  46.          _valid = _withread
  47.       ELSE
  48.          _valid = ".T."
  49.       ENDIF
  50.       _withread = .T.
  51.    ELSE
  52.       _withread = .F.
  53.    ENDIF
  54.  
  55.  
  56.    IF PCOUNT() < 3
  57.       RETURN(.F.)
  58.    ELSE
  59.       IF scr_level - 1 <= 0
  60.          _therow = _row + 0
  61.          _thecol = _col + 0
  62.       ELSE
  63.          _therow = _row + VAL(SUBSTR(allwindows[scr_level-1], 1,  2))
  64.          _thecol = _col + VAL(SUBSTR(allwindows[scr_level-1], 4,  2))
  65.       ENDIF
  66.    ENDIF
  67.  
  68.    
  69.    IF TYPE("_pict") != "U"
  70.       IF !("@"$_pict) .AND. TYPE(_get) = "C"          && if no at sign in picture and data type of 
  71.          *                                               the GET is of character type, then...
  72.    
  73.          _difference = ( LEN(Strvalue(_say)) + IF( (TYPE("_pict") = "U" ), ;
  74.                        LEN(Strvalue(_get)), LEN(_pict) ) + 2 ) - Wwidth()     
  75.          
  76.          * If empty(difference), o.k. or if difference is
  77.          * a negative number, it's o.k. too.  But is positive
  78.          * take the number, LTRIM(STR()) it and add and "@" to
  79.          * the pict of the GET so that it will fit in the
  80.          * window area...
  81.  
  82.          IF _difference > 0
  83.             _pict = "@S"
  84.             IF TYPE("_pict") = "U" 
  85.                _pict = _pict + LTRIM(STR(_difference - LEN(Strvalue(_get)) ))
  86.             ELSE
  87.                _pict = _pict + LTRIM(STR(_difference - LEN(_pict) ))
  88.             ENDIF
  89.          ENDIF
  90.       ENDIF
  91.    ELSE
  92.       IF TYPE("_get") != "U"
  93.          IF TYPE(_get) = "C"
  94.             _difference = ( LEN(Strvalue(_say)) + IF( (TYPE("_pict") = "U" ), ;
  95.                           LEN(Strvalue(_get)), LEN(_pict) ) + 2 ) - Wwidth()     
  96.             
  97.             * If empty(difference), o.k. or if difference is
  98.             * a negative number, it's o.k. too.  But is positive
  99.             * take the number, LTRIM(STR()) it and add and "@" to
  100.             * the pict of the GET so that it will fit in the
  101.             * window area...
  102.  
  103.             IF _difference > 0
  104.                _pict = "@S" + LTRIM(STR(_difference)) + IF( (TYPE("_pict") = "U" ), LEN(Strvalue(_get)), LEN(_pict) )
  105.             ENDIF
  106.          ENDIF
  107.       ENDIF
  108.    ENDIF
  109.  
  110.    IF TYPE("_pict") = "U"
  111.       IF TYPE("_get") != "U"
  112.          IF TYPE(_get) = "D"
  113.             _pict = "99/99/99"
  114.          ELSEIF TYPE(_get) = "M"
  115.             _pict = "@S10"
  116.          ELSEIF TYPE(_get) = "L"
  117.             _pict = "@!"
  118.          ENDIF
  119.       ENDIF
  120.    ENDIF
  121.  
  122.    IF TYPE("_get") = "U"
  123.       @ _therow, _thecol SAY _say
  124.  
  125.    ELSEIF TYPE("_get") != "U" .AND. TYPE("_valid") = "U"
  126.  
  127.       IF EMPTY(_say)                                               && No Say
  128.          IF TYPE("_pict") != "U"                                   && With Picture
  129.             IF TYPE(_get) = "U"
  130.             ELSE
  131.                @ _therow, _thecol GET &_get. PICT _pict
  132.             ENDIF
  133.          ELSE                                                      && Without Picture
  134.             IF TYPE(_get) = "U"
  135.             ELSE
  136.                @ _therow, _thecol GET &_get.
  137.             ENDIF
  138.          ENDIF
  139.       ELSE                                                         && With SAY
  140.          IF TYPE("_pict") != "U"                                   && With Picture
  141.             IF EMPTY(_get)
  142.                @ _therow, _thecol SAY _say PICT _pict
  143.             ELSE
  144.                IF TYPE(_get) = "U"
  145.                   @ _therow, _thecol SAY _say
  146.                ELSE
  147.                   @ _therow, _thecol SAY _say GET &_get. PICT _pict
  148.                ENDIF
  149.             ENDIF
  150.          ELSE                                                      && Without Picture
  151.             IF EMPTY(_get)
  152.                @ _therow, _thecol SAY _say 
  153.             ELSE
  154.                IF TYPE(_get) = "U"
  155.                   @ _therow, _thecol SAY _say
  156.                ELSE
  157.                   @ _therow, _thecol SAY _say GET &_get.
  158.                ENDIF
  159.             ENDIF
  160.          ENDIF
  161.       ENDIF
  162.  
  163.    ELSEIF TYPE("_valid") != "U"
  164.       IF TYPE(_valid) == "U"      && This tests for unresolved externals
  165.          _valid = ".T."
  166.       ENDIF
  167.       IF EMPTY(_say)
  168.          IF TYPE(_get) = "U"
  169.          ELSE
  170.             @ _therow, _thecol GET &_get. PICT _pict VALID &_valid.
  171.          ENDIF
  172.       ELSE
  173.          IF EMPTY(_get)
  174.             IF TYPE("_pict") != "U"
  175.                @ _therow, _thecol SAY _say PICT _pict 
  176.             ELSE
  177.                @ _therow, _thecol SAY _say
  178.             ENDIF
  179.          ELSE
  180.             IF TYPE(_get) = "U"
  181.                @ _therow, _thecol SAY _say
  182.             ELSE
  183.                IF TYPE("_pict") != "U"
  184.                   @ _therow, _thecol SAY _say GET &_get. PICT _pict VALID &_valid.
  185.                ELSE
  186.                   @ _therow, _thecol SAY _say GET &_get. VALID &_valid.
  187.                ENDIF
  188.             ENDIF
  189.          ENDIF
  190.       ENDIF
  191.    ENDIF
  192.  
  193.    IF _withread
  194.       scrcursor = .T.
  195.       SET CURSOR ON
  196.       READ
  197.       SET CURSOR OFF
  198.       scrcursor = .F.
  199.       RETURN( IF( (LASTKEY() = 27), .F., UPDATED() ) )
  200.    ELSE
  201.       RETURN(.T.)
  202.    ENDIF
  203.  
  204. * End of File
  205.