| $! WPS_CNV_WPC.COM
$!
$ set term/width=80
$!
$ Type sys$input
WPS-PLUS VAX/VMS to WordPerfect VAX/VMS Convertor
=================================================
This convertor converts all existing WPS-PLUS VAX/VMS documents
to WordPerfect VAX/VMS documents.
This procedure should be executed in the user's WPS-PLUS directory
The converted documents can be found in the WPCORP directory which
is located in the user's login directory.
The name of the converted document is made up by taking the original
WPS-PLUS document number and adding the extension ".WPC", e.g.
000399.WPC.
The file INDEX.TXT in the above mentioned WPCORP directory can
help to relate the current WordPerfect filename to its
original WPS-PLUS folder/title counterpart.
$ inquire t " Press return to continue"
$ set term/width=80
$ write sys$output "Checking current directory ...."
$ if f$extract(f$length(f$directory())-8,7,f$directory()) .NES. "WPSPLUS" -
then goto invalid
$!
$
$ if f$search(F$TRNLNM("SYS$LOGIN")+"WPCORP.DIR") .eqs. ""
$ then
$ wp_dir = F$trnlnm("SYS$LOGIN")- "]" + ".WPCORP]"
$ create/dir/log 'wp_dir
$ endif
$ wp_dir = F$trnlnm("SYS$LOGIN")- "]" + ".WPCORP]"
$ index = wp_dir + "INDEX.TXT"
$!
$ open/read docdb docdb.dat
$ open/write output 'index
$ loop:
$ read/index=2/end_of_file=close_all docdb record
$ Folder = f$extract(0,30,record)
$ Title = f$extract(113,70,record)
$ File = f$extract(48,20,record)
$ docnum = f$string(1000000-F$integer(F$extract(36,6,record)))
$ zero_loop:
$ if f$length(docnum) .LT. 6
$ then
$ docnum = "0" + docnum
$ goto zero_loop
$ endif
$ wpc_file = wp_dir+docnum+".wpc"
$ write output docnum," ",folder," ",title
$ write sys$output "Processing document (",docnum,") in folder ",folder
$ wp51/convert=document/from=wpl 'file 'wpc_file
$ goto loop
$!
$ close_all:
$ close docdb
$ close output
$!
$ sort 'index 'index
$ pu/nolog 'index
$ exit
$!
$ invalid:
$ write sys$output ""
$ write sys$output -
"This command procedure should be executed in the user's WPSPLUS directory..."
$ exit
|