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

  1. *******************
  2.  
  3. FUNCTION O_menu
  4.  
  5.    PARAMETERS _t, _doit
  6.  
  7.    IF EMPTY(PCOUNT())
  8.       RETURN("")
  9.    ELSEIF TYPE("_t") != "A"
  10.       RETURN("")
  11.    ENDIF
  12.  
  13.    _doit = IF((TYPE("_doit") != "L"), .F., _doit)
  14.  
  15.    * If the LEN() of the array is larger than 10, then the for LOOP
  16.    * will be used, otherwise, the hard-coded approach will be toggled.
  17.  
  18.    IF LEN(_t) > 10
  19.       FOR _qaz = 1 TO LEN(_t)
  20.          _tt = _t[_qaz]
  21.          _pit()
  22.       NEXT
  23.    ELSE
  24.       _tt = _t[1]
  25.       _pit()
  26.       IF LEN(_t) > 1
  27.          _tt = _t[2]
  28.          _pit()
  29.       ENDIF
  30.       IF LEN(_t) > 2
  31.          _tt = _t[3]
  32.          _pit()
  33.       ENDIF
  34.       IF LEN(_t) > 3
  35.          _tt = _t[4]
  36.          _pit()
  37.       ENDIF
  38.       IF LEN(_t) > 4
  39.          _tt = _t[5]
  40.          _pit()
  41.       ENDIF
  42.       IF LEN(_t) > 5
  43.          _tt = _t[6]
  44.          _pit()
  45.       ENDIF
  46.       IF LEN(_t) > 6
  47.          _tt = _t[7]
  48.          _pit()
  49.       ENDIF
  50.       IF LEN(_t) > 7
  51.          _tt = _t[8]
  52.          _pit()
  53.       ENDIF
  54.       IF LEN(_t) > 8
  55.          _tt = _t[9]
  56.          _pit()
  57.       ENDIF
  58.       IF LEN(_t) > 9
  59.          _tt = _t[10]
  60.          _pit()
  61.       ENDIF
  62.    ENDIF
  63.    scrcursor = .F.
  64.    SET CURSOR OFF
  65.    MENU TO _tempopt
  66.    SET CURSOR ON
  67.    scrcursor = .T.
  68.    IF EMPTY(_tempopt)
  69.       RETURN("")
  70.    ELSE
  71.       _proc = LTRIM(TRIM(SUBSTR(_t[_tempopt], RAT(";", _t[_tempopt])+1)))
  72.       IF _doit
  73.          IF TYPE("&_proc.()") = "UI"
  74.             DO &_proc.
  75.          ELSE
  76.             _proc = ""
  77.          ENDIF
  78.       ELSE
  79.          IF TYPE("&_proc.()") = "UI"
  80.          ELSE
  81.             _proc = ""
  82.          ENDIF
  83.       ENDIF
  84.       RETURN(_proc)
  85.    ENDIF
  86.  
  87. ********************
  88.  
  89. PROCEDURE _pit
  90.  
  91.    IF TYPE("allwindows") != "A"
  92.       _trow = 0
  93.       _tcol = 0
  94.    ELSEIF TYPE("scr_level") != "N"
  95.       _trow = 0
  96.       _tcol = 0
  97.    ELSEIF TYPE("allwindows[scr_level]") != "C"
  98.       _trow = 0
  99.       _tcol = 0
  100.    ELSE
  101.       _trow = VAL(LTRIM(SUBSTR(allwindows[scr_level-1], 1, 2)))
  102.       _tcol = VAL(LTRIM(SUBSTR(allwindows[scr_level-1], 4, 2)))
  103.    ENDIF
  104.  
  105.    @ VAL(LTRIM(TRIM(Parsing(@_tt, ";")))) + _trow, VAL(LTRIM(TRIM(Parsing(@_tt, ";")))) + _tcol PROMPT Parsing(@_tt, ";") MESSAGE Parsing(_tt, ";")
  106.  
  107. * End of File
  108.