home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 8 Other
/
08-Other.zip
/
rxjis096.zip
/
mimerecv.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1997-08-07
|
3KB
|
66 lines
/* product name: RXJIS */
/* Version: 0.40 */
/* author: YANO Takashi */
/* target: OS/2 Warp J3.0+ */
/* module name: MIMERECV.CMD */
/* source name: MIMERECV.CMD */
/* compiler: N.A. */
/* address: tyano@ca2.so-net.or.jp or tyano@yamato.ibm.co.jp */
/* comment: RXJIS is a utility functions for REXX. */
/* It encodes and decodes JIS 7 bit strings and MIME */
/* format strings. */
/* */
/* MIMERECV.CMD is a sample program how to use */
/* RXJIS. I am using it with PostRoadMailer 1.03a. */
/* It converts a mail message with MIME or JIS 7bit */
/* into PC Kanji codet mail message. */
/* */
/* how to use: MIMERECV fn */
/* fn is a mail message file. The converted result is */
/* in fn. The original is lost. */
/* */
/* history: 1996-2-5 0.00 initial release */
/* 1996-3-2 0.20 try to remove control chars in */
/* message. */
/* Use RxLoadFuncs. */
/* 1996-4-21 0.30 charset can be lower. */
/* 1996-5-1 0.40 Use RxJisMimeJisTo. */
/* 1996-5-24 0.51 Quit to translate control chars */
/* */
signal on novalue
arg fn
parse source . . a
workingdir = filespec('D', a) || filespec('P', a)
errorlog = workingdir || 'errorlog.log'
call rxfuncadd 'RxJisLoadFuncs', 'RXJIS', 'RxJisLoadFuncs'
call RxJisLoadFuncs
call rxfuncadd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs' /* A@0.20 */
call SysLoadFuncs /* A@0.20 */
if stream(fn, 'c', 'query exists') = '' then exit
do i = 1 by 1 while lines(fn)
line.i = linein(fn)
if line.i = '' then iterate
line.i = RxJisMimeJisTo(line.i)
end /* do */
call stream fn, 'c', 'close'
line.0 = i - 1
tfn = value('TMP', , 'OS2ENVIRONMENT')
if tfn = '' then tfn = workingdir
if right(tfn, 1) <> '\' then tfn = tfn || '\'
tfn = SysTempFileName(tfn || '????')
do i = 1 to line.0
call lineout tfn, line.i
end /* do */
call stream tfn, 'c', 'close'
'@copy' tfn fn
call SysFileDelete tfn
exit
novalue:
call lineout errorlog, date('S') time() condition('C') '@' sigl
call lineout errorlog, date('S') time() condition('D')
call lineout errorlog, date('S') time() condition('I')
call stream errorlog, 'c', 'close'
say 'SEE:' errorlog
exit