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

  1. ********************
  2.  
  3. FUNCTION Exploden
  4.  
  5.    PARAMETERS _thepict, _thenum
  6.  
  7.    PRIVATE _exprow, _expcol, _explstr, _keys, _disp, _vals, _comma
  8.    PRIVATE _atwhat, _exppass, _deci, _how
  9.  
  10.    _exprow = ROW()
  11.    _expcol = COL()
  12.    _explstr = SPACE(LEN(_thepict))
  13.    _keys = LEN(TRANSFORM(INT(VAL(STRIPFROM(_thepict, "$, "))), "@9"))+1
  14.    @ _exprow, _expcol GET _explstr PICT _thepict
  15.    CLEAR GETS
  16.  
  17.    _disp = ""
  18.    _vals  = ""
  19.    _atwhat = _expcol + IF(EMPTY(AT(".", _thepict)), LEN(_thepict), AT(".", _thepict)-1)
  20.    _dplaces = IF( (EMPTY(AT(".", _thepict))), 0, LEN(SUBSTR(_thepict, AT(".", _thepict)+1)))
  21.    _backtog = .F.
  22.    @ _exprow, _atwhat SAY ""
  23.    _deci = .F.
  24.    _comma   = 1
  25.    _exppass = 0
  26.    _how = 1
  27.  
  28.  
  29.  
  30.    DO WHILE INKEY(0) <> 13
  31.       DO CASE
  32.       CASE LASTKEY() = 27
  33.          EXIT
  34.       CASE LASTKEY() = ASC(".")
  35.          IF _dplaces = 0
  36.             LOOP
  37.          ENDIF
  38.          _disp = _disp + CHR(LASTKEY())
  39.          _vals = _vals + CHR(LASTKEY())
  40.          _how  = _keys - _dplaces
  41.          _tttt = VAL(_disp)
  42.          @ _exprow, _expcol GET _tttt PICT _thepict
  43.  
  44.       CASE (LASTKEY() = 19 .OR. LASTKEY() = 8 .OR. LASTKEY() = 7)
  45.          IF !_backtog
  46.             _atwhat = _atwhat + 1
  47.          ENDIF
  48.          _backtog = .T.
  49.          _disp = STRTRAN(IF( (LEN(_disp) = 1), "", LEFT(_disp, LEN(_disp)-1) ), " ", "")
  50.          _tttt = VAL(_disp)
  51.          _how = _how - 1
  52.          _vals = IF( (LEN(_vals) = 1), "", LEFT(_vals, LEN(_disp)-1) )
  53.  
  54.          @ _exprow, _expcol GET _tttt PICT _thepict
  55.          _atwhat = _atwhat + 1
  56.          IF _expcol < _atwhat
  57.             _atwhat = _expcol
  58.          ENDIF
  59.  
  60.       CASE (LASTKEY() >= 48 .AND. LASTKEY() <= 57 .OR. LASTKEY() = ASC("-"))
  61.          IF _how = _keys .AND. !_deci
  62.             LOOP
  63.          ENDIF
  64.          _backtog = .F.
  65.          IF _comma = 4
  66.             _disp = _disp + " "
  67.             _atwhat = _atwhat - 1
  68.             _comma = 1
  69.          ENDIF
  70.  
  71.          _disp = _disp + CHR(LASTKEY())
  72.          _how = _how + 1
  73.          _vals  = _vals + CHR(LASTKEY())
  74.          _comma   = _comma + 1
  75.  
  76.          @ _exprow, _atwhat-1 GET _disp PICT _thepict
  77.  
  78.          IF _exppass > 0
  79.             _atwhat = _atwhat + 1
  80.          ELSE
  81.             IF _atwhat > _expcol
  82.                _atwhat = _atwhat - 1
  83.             ENDIF
  84.          ENDIF
  85.  
  86.       ENDCASE
  87.  
  88.       CLEAR GETS
  89.  
  90.    ENDDO
  91.  
  92.    KEYBOARD CHR(LASTKEY())
  93.  
  94.    _thenum = VAL(_vals)
  95.  
  96.    @ _exprow, _expcol SAY ""
  97.  
  98.    RETURN("&_thepict.")
  99.  
  100. * End of File
  101.  
  102.