home *** CD-ROM | disk | FTP | other *** search
- ********************
-
- FUNCTION Prompt
-
- PARAMETERS _options, _sayings, _returns, _confirm, _ancolor
-
- IF PCOUNT() = 0
- _options = "YyNn"
- _sayings = "Yes/Yes/No /No "
- _returns = ".T./.T./.F./.F."
- _confirm = IF( (TYPE("scrconfirm") = "U"), .T., scrconfirm)
- _ancolor = .T.
- ELSEIF PCOUNT() = 1
- IF TYPE("_options") = "L"
- _confirm = _options
- _options = "YyNn"
- _sayings = "Yes/Yes/No /No "
- _returns = ".T./.T./.F./.F."
- _ancolor = .T.
- ELSE
- RETURN(.F.)
- ENDIF
- ELSEIF PCOUNT() = 2
- RETURN(.F.)
- ELSEIF PCOUNT() = 3
- _returns = UPPER(_returns)
- IF EMPTY(STRTRAN(STRTRAN(_returns, "+", ""), "/", "") ) && There are other characters other than a true or a false resposne
- RETURN(.F.)
- ENDIF
- _confirm = IF( (TYPE("scrconfirm") = "U"), .T., scrconfirm)
- _ancolor = .T.
- ELSE
- _ancolor = .T.
- ENDIF
- scrpause = IF( (TYPE("scrpause") = "U"), 100, scrpause)
- scrcolor = IF( (TYPE("scrcolor") = "U"), SETCOLOR(), scrcolor)
-
- PRIVATE _temp, _qaz, _row, _col, _posiion, _wcolor, _inside, _qaz
-
- _temp = ""
- _temp = _sayings && Put the string over to a
- DECLARE _sayings[OCCURENCE("/", _temp)+1] && temp and use the parameter
- FOR _qaz = 1 TO LEN(_sayings) && as the parameter as the new
- _sayings[_qaz] = PARSING(@_temp) && array of messages...
- NEXT
- _row = ROW()
- _col = COL()
- _position = 0
- _wcolor = SETCOLOR()
- IF _ancolor
- SETCOLOR(SET_COLOR(ATTRIBUTE(_row, _col+1)))
- ENDIF
-
- DO WHILE .T.
- _inside = CHR(INKEY(0))
-
- IF _confirm .AND. LASTKEY() = 13
- IF _position != 0
- EXIT
- ENDIF
- ELSE
- IF _inside$_options
- _position = AT(_inside, _options)
- @ _row, _col SAY _sayings[_position]
- IF !_confirm
- EXIT
- ENDIF
- ENDIF
- ENDIF
-
- ENDDO
-
- FOR _qaz = 1 TO scrpause
- NEXT
-
- SETCOLOR(_wcolor)
- FOR _qaz = 1 TO _position
- _temp = PARSING(@_returns)
- NEXT
-
- RETURN(&_temp.)
-
- * End of File