home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
nan_news
/
vol3
/
no5
/
spread.prg
< prev
next >
Wrap
Text File
|
1989-03-01
|
905b
|
35 lines
* Program: Spread.prg
* Author: Greg Lief
* Version: Clipper Summer '87
*
* Copyright (c) 1988-89 Greg Lief.
* Placed into Public Domain.
*
* Syntax: Spread(<message>, <row>, [<delay>, <midpoint>])
*
FUNCTION Spread
PARAM msg, row, delay, mid
* Initialize delay and midpoint if parameters not passed.
delay = IF(PCOUNT() < 3, 8, delay)
mid = IF(PCOUNT() < 4, 40, mid)
PRIVATE mlen, mloop, msg2, xx
* initialize memvar to hold temporary version of string
msg2 = ''
mlen = LEN(msg)
FOR mloop = 1 TO INT(mlen/2)
* Add characters to temp string from front and
* back of actual string.
msg2 = SUBSTR(msg, 1, mloop) + ;
SUBSTR(msg, mlen + 1 - mloop, mloop)
@ row, mid-mloop SAY msg2
FOR xx = 1 TO delay
NEXT
NEXT
* Must redraw string if length was not an even number.
IF mlen%2 = 1
@ row, mid-mloop SAY msg
ENDIF
RETURN('')
* EOF: Spread.prg