home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
workdb.zip
/
WSFILE.PRG
< prev
Wrap
Text File
|
1988-08-15
|
5KB
|
146 lines
*!!* dBASE CONVERT - dBASE III File Conversion Aid v2.01 1/10/86
*
SET HEADING OFF
SET SAFETY OFF
* wsfile.sig 08/18/83
* this module takes all of the data in the file and writes it to
* a Wordstar data file and creates a Wordstar DOC file. The letter
* or other document you are preparing is written after the introduction
* this program creates using the variables set forth in the DOC file.
* When you run mailmerge, you can personalize a document to everyone
* in the file. Since it takes time to write a big file - it gives
* you a running report on where it is in the file
CLEAR
*!! Unrecognized command.
?'This Module will make a special MailMerge file for WordStar'
*!! Unrecognized command.
?' Do you wish to continue (Y/N) ? '
SET CONSOLE OFF
WAIT TO command
SET CONSOLE ON
IF command = 'Y' .OR. command = 'y'
STORE .t. TO continue
ELSE
STORE .f. TO continue
ENDIF command = Y
DO WHILE continue
STORE 1 TO counter
CLEAR
*!! There will be no automatic colon following this prompt string.
ACCEPT 'Enter Name of the WordStar-MailMerge file ' TO file_dat
STORE UPPER(file_dat) TO file_dat
STORE SUBSTR(file_dat,1,8) TO file_dat
STORE file_dat+'.DOC' TO file_doc
STORE file_dat+'.DAT' TO file_dat
@ 03,10 SAY 'Creating WordStar-MailMerge Document file: '+file_doc
SET CONSOLE OFF
SET ALTERNATE TO &file:doc
SET ALTERNATE ON
?'.OP'
*!! Unrecognized command.
?'.DF '+file:dat
*!! Unrecognized command.
?'.RV '+' order-no,last-name, first-name,address1,address2,address3,city,state,zip,vol1,amount,entered,shipped,remark1,remark2,backord,,backo-ship1,backo-ship2,date-update'
*!! Unrecognized command.
?'.. to automatically omit empty data fields'
*!! Unrecognized command.
?'..print all items as "&item/o&" '
SET ALTERNATE OFF
SET CONSOLE ON
@ 05,10 SAY ' Creating WordStar-MailMerge Data file: '+file_dat
@ 07,10 SAY 'Writing record # '
SET CONSOLE OFF
SET ALTERNATE TO &file:dat
SET ALTERNATE ON
GOTO TOP
DO WHILE .NOT. EOF()
STORE CHR(34)+TRIM(lname) + CHR(34) TO lastname
IF fname = ' '
STORE ' ' TO firstname
ELSE
STORE CHR(34)+TRIM(fname) + CHR(34) TO firstname
ENDIF fname
IF addr1 = ' '
STORE ' ' TO address1
ELSE
STORE CHR(34)+TRIM(addr1)+CHR(34) TO address1
ENDIF addr1
IF addr2 = ' '
STORE ' ' TO address2
ELSE
STORE CHR(34)+TRIM(addr2)+CHR(34) TO address2
ENDIF addr2
IF addr3 = ' '
STORE ' ' TO address3
ELSE
STORE CHR(34)+TRIM(addr3)+chr(34) TO address3
ENDIF addr3
IF city = ' '
STORE ' ' TO city1
ELSE
STORE CHR(34)+TRIM(city)+CHR(34) TO city1
ENDIF city
IF state = ' '
STORE ' ' TO state1
ELSE
STORE chr(34)+state+CHR(34) TO state1
ENDIF state
IF zip = ' '
STORE ' ' TO zip1
ELSE
STORE CHR(34)+zip+CHR(34) TO zip1
ENDIF zip
IF vol1 = ' '
STORE ' ' TO volume1
ELSE
STORE CHR(34)+TRIM(vol1)+CHR(34) TO volume1
ENDIF vol1
IF rem1 = ' '
STORE ' ' TO remarks1
ELSE
STORE CHR(34)+TRIM(rem1)+CHR(34) TO remarks1
ENDIF rem1
IF rem2 = ' '
STORE ' ' TO remarks2
ELSE
STORE CHR(34)+trim(rem2)+CHR(34) TO remarks2
ENDIF rem2
IF bo = ' '
STORE ' ' TO backord1
ELSE
STORE CHR(34)+TRIM(bo)+CHR(34)TO backord1
ENDIF bo
?? lastname +','
?? firstname +','
?? address1 +','
?? address2 +','
?? address3 +','
?? city1 +','
?? volume1 +','
?? STR(amt,8,2) + ','
?? remarks1+','
?? remarks2 +','
?? backord1 +','
SKIP
SET CONSOLE ON
SET ALTERNATE OFF
SET CONSOLE ON
?? CHR(8) + CHR(8)+CHR(8)+CHR(8)+CHR(8)+CHR(8)+STR(COUNTER,5)
SET CONSOLE OFF
SET ALTERNATE ON
STORE COUNTER + 1 TO COUNTER
ENDDO while not EOF
STORE .f. TO continue
ENDDO continue
SET ALTERNATE OFF
SET CONSOLE ON
RELEASE file_dat,file_doc,continue,length,counter
STORE '?' TO command
STORE ' ' TO printer
STORE ' ' TO disk
STORE ' ' TO filename
STORE .t. TO more