home *** CD-ROM | disk | FTP | other *** search
- ********************
-
- FUNCTION Atsayget
-
- PARAMETERS _row, _col, _say, _get, _pict, _valid, _withread
-
- PRIVATE _wcolor
- _wcolor = SETCOLOR()
-
- 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("_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.
- IF TYPE("_valid") != "U"
- IF EMPTY(_valid)
- _valid = ".T."
- ENDIF
- ENDIF
- IF TYPE("_get") != "U"
- IF EMPTY(_get)
- RELEASE _get
- ENDIF
- ENDIF
-
- IF TYPE("_pict") != "U"
- IF EMPTY(_pict)
- RELEASE _pict
- ENDIF
- ENDIF
-
- IF TYPE("_say") != "U"
- IF EMPTY(_say)
- RELEASE _say
- ENDIF
- ENDIF
-
-
- ENDIF
-
- SETCOLOR(Set_color(Attribute(_row, _col+1)))
-
- IF PCOUNT() < 2
- SETCOLOR(_wcolor)
- RETURN(.F.)
- ELSEIF PCOUNT() = 2
- IF TYPE("_row")+TYPE("_col") != "NN"
- SETCOLOR(_wcolor)
- RETURN(.F.)
- ELSE
- @ _row, _col
- 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 ) - 80
-
- * 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
- ELSE
- IF TYPE("_get") != "U"
- IF TYPE(_get) = "C"
- _difference = ( LEN(Strvalue(_say)) + IF( (TYPE("_pict") = "U" ), ;
- LEN(Strvalue(_get)), LEN(_pict) ) + 2 ) - 80
-
- * 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"
- @ _row, _col 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
- @ _row, _col GET &_get. PICT _pict
- ENDIF
- ELSE && Without Picture
- IF TYPE("_get") = "U"
- ELSE
- @ _row, _col GET &_get.
- ENDIF
- ENDIF
- ELSE && With SAY
- IF TYPE("_pict") != "U" && With Picture
- IF EMPTY(_get)
- @ _row, _col SAY _say PICT _pict
- ELSE
- IF TYPE("_get") = "U"
- @ _row, _col SAY _say
- ELSE
- @ _row, _col SAY _say GET &_get. PICT _pict
- ENDIF
- ENDIF
- ELSE && Without Picture
- IF EMPTY(_get)
- @ _row, _col SAY _say
- ELSE
- IF TYPE("_get") = "U"
- @ _row, _col SAY _say
- ELSE
- @ _row, _col SAY _say GET &_get.
- ENDIF
- ENDIF
- ENDIF
- ENDIF
-
- ELSEIF TYPE("_valid") != "U"
- IF EMPTY(_say)
- IF TYPE("_get") = "U"
- ELSE
- @ _row, _col GET &_get. PICT _pict VALID &_valid.
- ENDIF
- ELSE
- IF TYPE("_get") = "U"
- IF TYPE("_pict") = "U"
- @ _row, _col SAY _say
- ELSE
- @ _row, _col SAY _say PICT _pict
- ENDIF
- ELSE
- IF TYPE("_pict") = "U"
- @ _row, _col SAY _say GET &_get. VALID &_valid.
- ELSE
- @ _row, _col SAY _say GET &_get. PICT _pict VALID &_valid.
- ENDIF
- ENDIF
- ENDIF
- ENDIF
-
- IF _withread
- scrcursor = .T.
- SET CURSOR ON
- READ
- SET CURSOR OFF
- scrcursor = .F.
- SETCOLOR(_wcolor)
- RETURN( IF( (LASTKEY() = 27), .F., UPDATED() ) )
- ELSE
- SETCOLOR(_wcolor)
- RETURN(.T.)
- ENDIF
-
- * End of File