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

  1. /*
  2.    Function: 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 fadeout /n/w/a
  8.  
  9.    Syntax: FadeOut(<filename>)
  10.  
  11.    Parameter: <filename> is a character string representing the name
  12.               of the file in which the random coordinates were saved.
  13.  
  14.    Returns: Nada
  15. */
  16.  
  17. //───── begin preprocessor directives
  18.  
  19. #include "fileio.ch"
  20. #include "grump.ch"
  21.  
  22. //───── end preprocessor directives
  23.  
  24. function fadeout(cfile)
  25. local nhandle := fopen(cfile, FO_READ), xx, ret_val := .f., ;
  26.       filesize := (maxrow() + 1) * (maxcol() + 1), buffer := space(2)
  27. if nhandle > -1
  28.    //───── verify that this file was saved in the same mode that we are in
  29.    //───── because if it wasn't, all hell will break loose further down
  30.    if fseek(nhandle, 0, FS_END) == filesize * 2
  31.       fseek(nhandle, 0, FS_SET)       // reset to start of file
  32.       ret_val := .t.
  33.       for xx = 1 to filesize
  34.          fread(nhandle, @buffer, 2)
  35.          @ bin2i(substr(buffer, 1, 1)), bin2i(substr(buffer, 2, 1)) ssay [ ]
  36.       next
  37.    endif
  38.    fclose(nhandle)
  39. endif
  40. return ret_val
  41.  
  42. * end function FadeOut()
  43. *--------------------------------------------------------------------*
  44.  
  45. * eof fadeout.prg
  46.