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

  1. /*
  2.     Program: SPREAD()
  3.     System: GRUMPFISH LIBRARY
  4.     Author: Greg Lief
  5.     Copyright (c) 1988-90, Greg Lief
  6.     Clipper 5.x version
  7.     Compile instructions: clipper spread /n/w/a
  8.     Displays a character string from the center out
  9. */
  10.  
  11. //───── begin preprocessor directives
  12.  
  13. #include "grump.ch"
  14.  
  15. //───── end preprocessor directives
  16.  
  17. function Spread(cmsg, nrow, ndelay, nmidpoint)
  18. local nlength := len(cmsg), xx, yy
  19. default ndelay to 8
  20. default nmidpoint to 40
  21. for xx = 1 to int(nlength / 2)
  22.    @ nrow, nmidpoint - xx ssay substr(cmsg, 1, xx) + ;
  23.                                substr(cmsg, nlength + 1 - xx, xx)
  24.    for yy = 1 to ndelay
  25.    next
  26. next
  27. //───── if message was of odd length, redraw entire thing now
  28. if nlength % 2 == 1
  29.    @ nrow, nmidpoint - xx say cmsg
  30. endif
  31. return NIL
  32.  
  33. * end function Spread()
  34. *--------------------------------------------------------------------*
  35.  
  36. * eof spread.prg
  37.