Category : Word Perfect
Archive   : PX2WP.ZIP
Filename : PX2WP51.SC

 
Output of file : PX2WP51.SC contained in archive : PX2WP.ZIP

;*************************************************************************
; Script Listing
; Date : 02/11/91
; Time : 11:04:57 pm
;
; System : PX2WP5
; File Name : e:\mrgprog\px2wp51.sc
; By : Jonathan Goldman
; Last modified 02/11/91 10:54:34 pm
; Copyright (c) 1991 Jonathan Goldman
;*************************************************************************

PROC writefile(tablname.a,outfil.a)
fs.a = "\14\10"
ns.a = "\157"
ne.a = "\156\10"
eon.a = "\18\10\5\12"
eof.a = "\18"
eor.a = "\5"

MENU
{TOOLS} {INFO} {STRUCTURE}
SELECT tablname.a
@20,10
CLEAR EOL
?? "Writing field name information"
PRINT FILE outfil.a fs.a
VIEW "struct"
SCAN
PRINT FILE outfil.a ns.a,[field name],ne.a
ENDSCAN
PRINT FILE outfil.a eon.a
CLEARALL
VIEW tablname.a
n2.n = NFIELDS(tablname.a) + 1
@20,10
CLEAR EOL
??"Writing record: "
SCAN
COPYTOARRAY outrec.r
FOR n1.n FROM 2 TO n2.n
IF TYPE(outrec.r[n1.n]) <> "D"
THEN PRINT FILE outfil.a outrec.r[n1.n],eof.a
ELSE PRINT FILE outfil.a FORMAT("D2",outrec.r[n1.n]),eof.a
ENDIF
ENDFOR
PRINT FILE outfil.a eor.a
@20,30
??recno()
ENDSCAN

ENDPROC

CLEAR
SETMARGIN 10
TEXT




Paradox to WordPerfect Conversion

The selected file will be converted to a WordPerfect 5.1 secondary
merge file. When this is finished, the file may be merged by
selecting it as the secondary merge file. When creating the primary
file, use the actual field name as the field identifier. Dates
will be converted as strings (e.g.: January 5,1991.)

ENDTEXT

SHOWTABLES
DIRECTORY()
"Select file to convert and press Enter"
TO tablname.a
outfil.a = (tablname.a+".sf")
@20,10
?? tablname.a," will be converted to the WP 5.1 merge file: ",outfil.a"."

IF ISFILE(outfil.a)
THEN
MESSAGE outfil.a," already exists."
@22,10

??"Deleting existing ",outfil.a,"."
RUN NOREFRESH "DEL "+outfil.a+" > nul"
@22,10
CLEAR EOL
ENDIF

writefile(tablname.a,outfil.a)
RESET