home *** CD-ROM | disk | FTP | other *** search
- ********************
-
- FUNCTION Exploden
-
- PARAMETERS _thepict, _thenum
-
- PRIVATE _exprow, _expcol, _explstr, _keys, _disp, _vals, _comma
- PRIVATE _atwhat, _exppass, _deci, _how
-
- _exprow = ROW()
- _expcol = COL()
- _explstr = SPACE(LEN(_thepict))
- _keys = LEN(TRANSFORM(INT(VAL(STRIPFROM(_thepict, "$, "))), "@9"))+1
- @ _exprow, _expcol GET _explstr PICT _thepict
- CLEAR GETS
-
- _disp = ""
- _vals = ""
- _atwhat = _expcol + IF(EMPTY(AT(".", _thepict)), LEN(_thepict), AT(".", _thepict)-1)
- _dplaces = IF( (EMPTY(AT(".", _thepict))), 0, LEN(SUBSTR(_thepict, AT(".", _thepict)+1)))
- _backtog = .F.
- @ _exprow, _atwhat SAY ""
- _deci = .F.
- _comma = 1
- _exppass = 0
- _how = 1
-
-
-
- DO WHILE INKEY(0) <> 13
- DO CASE
- CASE LASTKEY() = 27
- EXIT
- CASE LASTKEY() = ASC(".")
- IF _dplaces = 0
- LOOP
- ENDIF
- _disp = _disp + CHR(LASTKEY())
- _vals = _vals + CHR(LASTKEY())
- _how = _keys - _dplaces
- _tttt = VAL(_disp)
- @ _exprow, _expcol GET _tttt PICT _thepict
-
- CASE (LASTKEY() = 19 .OR. LASTKEY() = 8 .OR. LASTKEY() = 7)
- IF !_backtog
- _atwhat = _atwhat + 1
- ENDIF
- _backtog = .T.
- _disp = STRTRAN(IF( (LEN(_disp) = 1), "", LEFT(_disp, LEN(_disp)-1) ), " ", "")
- _tttt = VAL(_disp)
- _how = _how - 1
- _vals = IF( (LEN(_vals) = 1), "", LEFT(_vals, LEN(_disp)-1) )
-
- @ _exprow, _expcol GET _tttt PICT _thepict
- _atwhat = _atwhat + 1
- IF _expcol < _atwhat
- _atwhat = _expcol
- ENDIF
-
- CASE (LASTKEY() >= 48 .AND. LASTKEY() <= 57 .OR. LASTKEY() = ASC("-"))
- IF _how = _keys .AND. !_deci
- LOOP
- ENDIF
- _backtog = .F.
- IF _comma = 4
- _disp = _disp + " "
- _atwhat = _atwhat - 1
- _comma = 1
- ENDIF
-
- _disp = _disp + CHR(LASTKEY())
- _how = _how + 1
- _vals = _vals + CHR(LASTKEY())
- _comma = _comma + 1
-
- @ _exprow, _atwhat-1 GET _disp PICT _thepict
-
- IF _exppass > 0
- _atwhat = _atwhat + 1
- ELSE
- IF _atwhat > _expcol
- _atwhat = _atwhat - 1
- ENDIF
- ENDIF
-
- ENDCASE
-
- CLEAR GETS
-
- ENDDO
-
- KEYBOARD CHR(LASTKEY())
-
- _thenum = VAL(_vals)
-
- @ _exprow, _expcol SAY ""
-
- RETURN("&_thepict.")
-
- * End of File
-