home *** CD-ROM | disk | FTP | other *** search
- *******************
-
- FUNCTION O_menu
-
- PARAMETERS _t, _doit
-
- IF EMPTY(PCOUNT())
- RETURN("")
- ELSEIF TYPE("_t") != "A"
- RETURN("")
- ENDIF
-
- _doit = IF((TYPE("_doit") != "L"), .F., _doit)
-
- * If the LEN() of the array is larger than 10, then the for LOOP
- * will be used, otherwise, the hard-coded approach will be toggled.
-
- IF LEN(_t) > 10
- FOR _qaz = 1 TO LEN(_t)
- _tt = _t[_qaz]
- _pit()
- NEXT
- ELSE
- _tt = _t[1]
- _pit()
- IF LEN(_t) > 1
- _tt = _t[2]
- _pit()
- ENDIF
- IF LEN(_t) > 2
- _tt = _t[3]
- _pit()
- ENDIF
- IF LEN(_t) > 3
- _tt = _t[4]
- _pit()
- ENDIF
- IF LEN(_t) > 4
- _tt = _t[5]
- _pit()
- ENDIF
- IF LEN(_t) > 5
- _tt = _t[6]
- _pit()
- ENDIF
- IF LEN(_t) > 6
- _tt = _t[7]
- _pit()
- ENDIF
- IF LEN(_t) > 7
- _tt = _t[8]
- _pit()
- ENDIF
- IF LEN(_t) > 8
- _tt = _t[9]
- _pit()
- ENDIF
- IF LEN(_t) > 9
- _tt = _t[10]
- _pit()
- ENDIF
- ENDIF
- scrcursor = .F.
- SET CURSOR OFF
- MENU TO _tempopt
- SET CURSOR ON
- scrcursor = .T.
- IF EMPTY(_tempopt)
- RETURN("")
- ELSE
- _proc = LTRIM(TRIM(SUBSTR(_t[_tempopt], RAT(";", _t[_tempopt])+1)))
- IF _doit
- IF TYPE("&_proc.()") = "UI"
- DO &_proc.
- ELSE
- _proc = ""
- ENDIF
- ELSE
- IF TYPE("&_proc.()") = "UI"
- ELSE
- _proc = ""
- ENDIF
- ENDIF
- RETURN(_proc)
- ENDIF
-
- ********************
-
- PROCEDURE _pit
-
- IF TYPE("allwindows") != "A"
- _trow = 0
- _tcol = 0
- ELSEIF TYPE("scr_level") != "N"
- _trow = 0
- _tcol = 0
- ELSEIF TYPE("allwindows[scr_level]") != "C"
- _trow = 0
- _tcol = 0
- ELSE
- _trow = VAL(LTRIM(SUBSTR(allwindows[scr_level-1], 1, 2)))
- _tcol = VAL(LTRIM(SUBSTR(allwindows[scr_level-1], 4, 2)))
- ENDIF
-
- @ VAL(LTRIM(TRIM(Parsing(@_tt, ";")))) + _trow, VAL(LTRIM(TRIM(Parsing(@_tt, ";")))) + _tcol PROMPT Parsing(@_tt, ";") MESSAGE Parsing(_tt, ";")
-
- * End of File