home *** CD-ROM | disk | FTP | other *** search
- *******************
-
- FUNCTION Wsayget
-
- PARAMETERS _row, _col, _say, _get, _pict, _valid, _withread
-
- IF PCOUNT() = 1
- IF TYPE("_row") = "L"
- scrcursor = .T.
- SET CURSOR ON
- IF _row
- READ
- ELSE
- CLEAR GETS
- ENDIF
- SET CURSOR OFF
- RETURN( IF( (LASTKEY() = 27), .F., UPDATED() ) )
- ENDIF
- ENDIF
-
- IF TYPE("scr_level") != "N"
- scr_level = 0
- ENDIF
-
- IF TYPE("_row") = "L"
- IF TYPE("_col") != "U"
- _row = _col
- ENDIF
- IF TYPE("_say") != "U"
- _col = _say
- _say = ""
- ENDIF
- IF TYPE("_get") != "U"
- _say = _get
- _get = ""
- ENDIF
- IF TYPE("_pict") != "U"
- _get = _pict
- _pict = ""
- ENDIF
- IF TYPE("_valid") != "U"
- _pict = _valid
- _valid = ".T."
- ENDIF
- IF TYPE("_withread") != "U"
- _valid = _withread
- ELSE
- _valid = ".T."
- ENDIF
- _withread = .T.
- ELSE
- _withread = .F.
- ENDIF
-
-
- IF PCOUNT() < 3
- RETURN(.F.)
- ELSE
- IF scr_level - 1 <= 0
- _therow = _row + 0
- _thecol = _col + 0
- ELSE
- _therow = _row + VAL(SUBSTR(allwindows[scr_level-1], 1, 2))
- _thecol = _col + VAL(SUBSTR(allwindows[scr_level-1], 4, 2))
- ENDIF
- ENDIF
-
-
- IF TYPE("_pict") != "U"
- IF !("@"$_pict) .AND. TYPE(_get) = "C" && if no at sign in picture and data type of
- * the GET is of character type, then...
-
- _difference = ( LEN(Strvalue(_say)) + IF( (TYPE("_pict") = "U" ), ;
- LEN(Strvalue(_get)), LEN(_pict) ) + 2 ) - Wwidth()
-
- * If empty(difference), o.k. or if difference is
- * a negative number, it's o.k. too. But is positive
- * take the number, LTRIM(STR()) it and add and "@" to
- * the pict of the GET so that it will fit in the
- * window area...
-
- IF _difference > 0
- _pict = "@S"
- IF TYPE("_pict") = "U"
- _pict = _pict + LTRIM(STR(_difference - LEN(Strvalue(_get)) ))
- ELSE
- _pict = _pict + LTRIM(STR(_difference - LEN(_pict) ))
- ENDIF
- ENDIF
- ENDIF
- ELSE
- IF TYPE("_get") != "U"
- IF TYPE(_get) = "C"
- _difference = ( LEN(Strvalue(_say)) + IF( (TYPE("_pict") = "U" ), ;
- LEN(Strvalue(_get)), LEN(_pict) ) + 2 ) - Wwidth()
-
- * If empty(difference), o.k. or if difference is
- * a negative number, it's o.k. too. But is positive
- * take the number, LTRIM(STR()) it and add and "@" to
- * the pict of the GET so that it will fit in the
- * window area...
-
- IF _difference > 0
- _pict = "@S" + LTRIM(STR(_difference)) + IF( (TYPE("_pict") = "U" ), LEN(Strvalue(_get)), LEN(_pict) )
- ENDIF
- ENDIF
- ENDIF
- ENDIF
-
- IF TYPE("_pict") = "U"
- IF TYPE("_get") != "U"
- IF TYPE(_get) = "D"
- _pict = "99/99/99"
- ELSEIF TYPE(_get) = "M"
- _pict = "@S10"
- ELSEIF TYPE(_get) = "L"
- _pict = "@!"
- ENDIF
- ENDIF
- ENDIF
-
- IF TYPE("_get") = "U"
- @ _therow, _thecol SAY _say
-
- ELSEIF TYPE("_get") != "U" .AND. TYPE("_valid") = "U"
-
- IF EMPTY(_say) && No Say
- IF TYPE("_pict") != "U" && With Picture
- IF TYPE(_get) = "U"
- ELSE
- @ _therow, _thecol GET &_get. PICT _pict
- ENDIF
- ELSE && Without Picture
- IF TYPE(_get) = "U"
- ELSE
- @ _therow, _thecol GET &_get.
- ENDIF
- ENDIF
- ELSE && With SAY
- IF TYPE("_pict") != "U" && With Picture
- IF EMPTY(_get)
- @ _therow, _thecol SAY _say PICT _pict
- ELSE
- IF TYPE(_get) = "U"
- @ _therow, _thecol SAY _say
- ELSE
- @ _therow, _thecol SAY _say GET &_get. PICT _pict
- ENDIF
- ENDIF
- ELSE && Without Picture
- IF EMPTY(_get)
- @ _therow, _thecol SAY _say
- ELSE
- IF TYPE(_get) = "U"
- @ _therow, _thecol SAY _say
- ELSE
- @ _therow, _thecol SAY _say GET &_get.
- ENDIF
- ENDIF
- ENDIF
- ENDIF
-
- ELSEIF TYPE("_valid") != "U"
- IF TYPE(_valid) == "U" && This tests for unresolved externals
- _valid = ".T."
- ENDIF
- IF EMPTY(_say)
- IF TYPE(_get) = "U"
- ELSE
- @ _therow, _thecol GET &_get. PICT _pict VALID &_valid.
- ENDIF
- ELSE
- IF EMPTY(_get)
- IF TYPE("_pict") != "U"
- @ _therow, _thecol SAY _say PICT _pict
- ELSE
- @ _therow, _thecol SAY _say
- ENDIF
- ELSE
- IF TYPE(_get) = "U"
- @ _therow, _thecol SAY _say
- ELSE
- IF TYPE("_pict") != "U"
- @ _therow, _thecol SAY _say GET &_get. PICT _pict VALID &_valid.
- ELSE
- @ _therow, _thecol SAY _say GET &_get. VALID &_valid.
- ENDIF
- ENDIF
- ENDIF
- ENDIF
- ENDIF
-
- IF _withread
- scrcursor = .T.
- SET CURSOR ON
- READ
- SET CURSOR OFF
- scrcursor = .F.
- RETURN( IF( (LASTKEY() = 27), .F., UPDATED() ) )
- ELSE
- RETURN(.T.)
- ENDIF
-
- * End of File