home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
MBUG
/
MBUG084.ARC
/
DBLINES.TXT
< prev
next >
Wrap
Text File
|
1979-12-31
|
2KB
|
78 lines
HERE IS A DBASE COMMAND TO BREAK UP A LARGE FIELD INTO LINES OF
WHATEVER LENGTH YOU WANT - SAY THE FIELD IS 240 CHARACTERS,
YOU WOULD PUT SEMICOLONS IN THE FILE TO MAKE THE PRINTER DO
LINES OF A REASONABLE SIZE, BUT IF THE INFORMATION DOES NOT HAVE
SEMICOLON╙á I╬á I╘á THE╬ THI╙ I╙ ┴ WA┘ O╞ PRINTIN╟ I╘á INT╧á SUC╚
LINES. BY BRIAN BELL OF GLENBROOK N.S.W WRITTEN MARCH 1986
MODIFY COMMAND DISPLAY.
USE (FILENAME)
ERAS
SET TALK OFF
* SET UP LINE WIDTH REQUIRED
STOR ' ' TO L
@ 3,5 SAY'LINE WIDTH'GET L
? CHR(7)
SET BELL OFF
READ NOUP
SET BELL ON
* SET UP LOOP TO PRINT ITEMS IN ANY ORDER YOU WANT
DO WHIL T
ERAS
* SET UP A VARIABLE TO GET TO THE RIGHT POSITION
STOR ' ' TO B
@ 5,5 SAY 'NUMBER - ZERO TO QUIT'GET B
?? CHR(7)
SET BELL OFF
READ NOUP
SET BELL ON
IF B = '0'
SET TALK ON
RETU
ENDI
GOTO RECO &B
* RECORD THE LENGTH OF THE TRIMMED FIELD
STOR LEN(TRIM(FIELDNAME)) TO LT
* SET UP VARIABLE TO RECORD HOW MUCH IS LEFT TO PRINT
STOR LT TO LN
* SET UP A (FLOATING) START POSITION
STOR 1 TO LG
* TAKE CARE OF INDENTATION OCCURING ON LINES AFTER LINE 1
STOR 0 TO LINE1
* SET UP END OF NEXT LINE VARIABLE
STOR 0 TO LH
* MAKE IT PRINT UNTIL FIELD IS ALL PRINTED
DO WHIL LN > 1
* ADD MAXIMUM LINE WIDTH TO STARTING POSITION VARIABLE
STOR &L+LH TO LH
* TAKE CARE OF CASES OF FULL FIELDS
IF LH >= 250
? $(FIELDNAME,LG,251-LG)
STOR 0 TO LN
LOOP
ENDIFè* TAKE CARE OF LENGTH AND MAKE IT ALL FULL WORDS
DO WHIL $(FIELDNAME,LH,1)#' '
STOR LH-1 TO LH
ENDD
* TAKE CARE OF INDENTATION
IF LINE1<1
SET RAW ON
? ' '
SET RAW OFF
ELSE
?
ENDIF
* PRINT A LINE AND SET VARIABLES FOR NEXT LINE
?? $(FIELDNAME,LG,LH-LG)
STOR 1+LINE1 TO LINE1
STOR LN-(LH-LG) TO LN
STOR LH TO LG
ENDD
* PUT A WAIT OPTION HERE IF REQUIRED
WAIT
ENDD DISPLAY
CONTROL W TO SAVE THE FILE DO DISPLAY TO RUN IT......