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
/
MBUG019.ARC
/
DBASE.HNT
< prev
next >
Wrap
Text File
|
1979-12-31
|
2KB
|
62 lines
dBASE II - PROGRAMMING HINTS part 1
1. PRINTING FILE INFORMATION ONTO SEPARATE PAGES.
If you, like myself, cannot set up your printouts easily with
the report function, for example if you have a need to print data
from three records onto one line, then here is the way to make
the machinery stop when it it time to go to the next page, in
cases where you are using single sheets of paper.
Firstly before your DO WHILE loop, enter a line as follows:-
STORE 0 TO PAGE (zero, not O for orange)
Next, each time you print a line within the loop, enter a line:-
STORE 1+PAGE TO PAGE
Then enter these lines before your ENDDO
IF PAGE = 60 *( or however many lines you need per page)
*¿ thi≤ caε bσ ß variablσ amoun⌠ iµ yo⌡ arσ clever)
?' TIME TO CHANGE PAPER - PRESS SPACE BAR WHEN READY TO PROCEED'
SET CONSOLE OFF
WAIT
SET CONSOLE ON
STORE 0 TO PAGE *resets the variable to start on next page
ENDIF
2.LISTING A VARIABLE LENGTH FIELD ITEM IN TWO PARTS
Recently while workinτ ou⌠ ß prograφ t∩ prin⌠ ß Vide∩
Dealer'≤ catalogue¼ thi≤ requiremen⌠ arosσ becausσ thσ title≤ oµ the
movies were anything from 10 to 55 letters in length (the field
length was 55 characters), but the majority were under 25 letters
and two columns per page were wanted in the catalogue. This form
madσ thσ titlσ comσ ou⌠ iε tw∩ line≤ iµ i⌠ wa≤ morσ thaε 3░ letters.
This is how I solved the problem. It has since been useful
on another occasion and that time it worked straight away!
STORE 30 TO RETRY *RETRY being the name of a new memory variable
IF LEN(TRIM(TITLE)) > 30
DO WHILE $(TITLE,RETRY,1) # ' ' *looking for a blank space
STOR RETRY-1 TO RETRY *changing length of line
ENDDO
? $(TITLE,1,RETRY) *printing first part of title
? $(TITLE,RETRY,55-RETRY) *printing remainder of title
ELSE
? TITLE
ENDIF
More hints next page.
è