home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / mbug / mbug019.arc / DBASE.HNT < prev    next >
Text File  |  1979-12-31  |  2KB  |  62 lines

  1.                  dBASE II - PROGRAMMING HINTS  part 1
  2.      
  3. 1. PRINTING FILE INFORMATION ONTO SEPARATE PAGES.
  4.  
  5.      If you, like myself, cannot set up your printouts easily with
  6. the report function, for example if you have a need to print data
  7. from three records onto one line, then here is the way to make
  8. the machinery stop when it it time to go to the next page, in 
  9. cases where you are using single sheets of paper.
  10.  
  11. Firstly before your DO WHILE loop, enter a line as follows:-
  12.  
  13. STORE 0 TO PAGE  (zero, not O for orange)
  14.  
  15. Next, each time you print a line within the loop, enter a line:-
  16.  
  17. STORE 1+PAGE TO PAGE
  18.  
  19. Then enter these lines before your ENDDO
  20.  
  21. IF PAGE = 60   *( or however many lines you need per page)
  22.                *¿ thi≤ caε bσ ß variablσ amoun⌠ iµ yo⌡ arσ clever)
  23. ?' TIME TO CHANGE PAPER - PRESS SPACE BAR WHEN READY TO PROCEED'
  24. SET CONSOLE OFF
  25. WAIT
  26. SET CONSOLE ON
  27. STORE 0 TO PAGE  *resets the variable to start on next page
  28. ENDIF
  29.  
  30. 2.LISTING A VARIABLE LENGTH FIELD ITEM IN TWO PARTS 
  31.  
  32.      Recently while workinτ ou⌠ ß prograφ t∩ prin⌠ ß Vide∩ 
  33. Dealer'≤ catalogue¼ thi≤ requiremen⌠ arosσ becausσ thσ title≤ oµ the
  34. movies were anything from 10 to 55 letters in length (the field
  35. length was 55 characters), but the majority were under 25 letters
  36. and two columns per page were wanted in the catalogue.  This form
  37. madσ thσ titlσ comσ ou⌠ iε tw∩ line≤ iµ i⌠ wa≤ morσ thaε 3░ letters.
  38.  
  39.      This is how I solved the problem. It has since been useful
  40. on another occasion and that time it worked straight away!
  41.  
  42. STORE 30 TO RETRY  *RETRY being the name of a new memory variable 
  43. IF LEN(TRIM(TITLE)) > 30
  44. DO WHILE $(TITLE,RETRY,1) # ' '  *looking for a blank space
  45.  STOR RETRY-1 TO RETRY           *changing length of line
  46. ENDDO
  47. ? $(TITLE,1,RETRY)               *printing first part of title
  48. ? $(TITLE,RETRY,55-RETRY)        *printing remainder of title
  49. ELSE 
  50. ? TITLE
  51. ENDIF
  52.                                   More hints next page.
  53.                          
  54.  
  55. è
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.