home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / MSWBASE4.ZIP / IDEAS / WPLET.SBP < prev   
Encoding:
Text File  |  1989-09-18  |  2.3 KB  |  75 lines

  1. SBP
  2.   ╜  'wplet' mailmerge for WordPerfect
  3.  
  4.   ╜ select phase
  5.   ╫c1$(25,1)
  6.   å t
  7. a: f$ "": ┬"Open file","",11,a%,f$: ╜ ***** Select File for data *****
  8.   ía% 0 p Æ
  9.  
  10.   ç:f1$ f$
  11.   ┤ Öf1$
  12.   ╜ **************** Now strip path off filename
  13. a0: f%  ?(1,f$,"\"): íf% pf$  -(f$, /(f$) f%): wa0
  14. b$ "":c$ "":b1$ "? ":lct% 0:blk% 1
  15.  
  16.   ╜ *********************************************** Now get fields in blocks *
  17.   ¢i% 1 q25:c1$(i%,0) "":c1$(i%,1) "": ▒i%
  18.  
  19. a1: b$ "Block "  (blk%,"99") " = "
  20.  
  21. b: a$ "": ┬b$,"select another or <CANCEL> to end this block",5,a%,a$
  22.   ía% 0 p wc
  23.  b$ b$ a$ ",": í /(b$) 60 pb1$ b$:b$ "Block "  (blk%,"99") " = ..."  -(b1$,35)
  24.  lct% lct% 1
  25.  c1$(lct%,0) a$ "." f$
  26.   wb 
  27.  
  28. c: c1$(lct%,1)  (18)
  29.  c$ c$  +(b$, /(b$) 1) "/"
  30.   ┬"Another block","",21,a%: ía% pb$ "":blk% blk% 1:b1$ "? ": wa1
  31.  c$ c$ "#"
  32.  lct% lct% 1
  33.  c1$(lct%,1)  (5)
  34.   {c$
  35.  
  36.   ╜ now 'pseudo export'
  37.  
  38. d1:  ┬"Current index is "  ú "." f$,"Select Index to define order <CANCEL> for "  ú,7,a%,i$: ╜ ******** define order *******
  39.  
  40.   ía% pz$ "INDEX " i$ "." f$: ûz$
  41. d2:  ╔ ╨ ~: ╜ **************************************** ask for filter *****
  42.  
  43.  ╔ `
  44.  í B(f$) p ┬"No records found matching this filter","",1,a%: ía% p wd2  ^ wgetout
  45. ct% 0
  46. d3:  ┬"Enter Merge File Name","<CANCEL> to end",17,a%,mf$: ╜ ** get merge file *
  47.  ╜ *********************************************************** check ovrewrite/append
  48.  ía% 0 p wgetout 
  49.  í O( J(mf$)) p ┤mf$ ¢ ╢: wd4
  50.  ┬"Mergefile " mf$ " exists","<OK> to Overwrite or Append, <CANCEL> to re-choose",1,a%
  51.  ía% 0 p wd3
  52.  ┬mf$,"<OK> to Overwrite,  < CANCEL > TO APPEND ",1,a%
  53.  ía% p ┤mf$ ¢ ╢ ^ ┤mf$ ¢ T
  54. d4:  ╪ O B(f$)
  55.  ¢i% 1 qlct%
  56.  ╜ **************** set up '? fieldname.file;' **************************** 
  57.  íi% lct% p
  58. zz$ "zz% = LEN(TRIM$(" c1$(i%,0) "))": ûzz$
  59.  ízz% pzz$ "? " c1$(i%,0) ";": ûzz$
  60.  ízz%  c1$(i%,1)  (18) pzz% zz% 1: { (18);: ╜ *** if end block CTRL/R ****
  61.  Æ í
  62.  íc1$(i%,1)  (5) pzz% zz% 1: { (5);: ╜ ***** if end record CTRL/E ***
  63.  ízz% p { (10);: ╜ ******************************** anyway <NEWLINE> *******
  64.  ▒i%
  65. ct% ct% 1
  66.  ╔ ▒
  67.  ┘
  68.  å ╢
  69.   {: {&5.0ct%," records exported to " mf$
  70. getout:  ╔ ╨
  71.   ╜ LIST mf$
  72.   Æ
  73.  
  74.  
  75.