home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a067 / 1.img / GRUMP501.EXE / SVFADEO.PRG < prev    next >
Encoding:
Text File  |  1991-04-23  |  1.1 KB  |  41 lines

  1. /*
  2.    Function: Sv_FadeOut()
  3.    System: GRUMPFISH LIBRARY
  4.    Author: Greg Lief
  5.    Copyright (c) 1988-90, Greg Lief
  6.    Clipper 5.x Version
  7.    Compile instructions: clipper svfadeo /n/w/a
  8.  
  9.    Syntax: Sv_FadeOut(<filename>)
  10.  
  11.    Parameter: <filename> is a character string representing the name
  12.               of file in which to save the random coordinates.
  13.  
  14.    Returns: Nada
  15. */
  16. function Sv_FadeOut(cfile)
  17. local maxrow := maxrow()+1, maxcol := maxcol()+1, x, mrow, mcol
  18. local elements := maxrow * maxcol, oldprinter := set(_SET_PRINTFILE, cfile)
  19. local oldconsole := set(_SET_CONSOLE, .F.), a[elements], ncount := 0
  20. set print on
  21. afill(a, 0)
  22. do while ncount < elements
  23.    x := gfrand(elements)
  24.    if a[x+1] == 0
  25.       a[x+1] := 1
  26.       mrow := INT(x / maxcol)
  27.       mcol := INT(x % maxcol)
  28.       ?? chr(mrow) + chr(mcol)
  29.       ncount++
  30.    ENDIF
  31. ENDDO
  32. set(_SET_PRINTFILE, oldprinter)
  33. set(_SET_CONSOLE, oldconsole)
  34. set print off
  35. return NIL
  36.  
  37. * end function Sv_FadeOut()
  38. *--------------------------------------------------------------------*
  39.  
  40. * eof: svfadeo.prg
  41.