home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 2 BBS
/
02-BBS.zip
/
SRI.ZIP
/
TEST.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1992-09-08
|
2KB
|
103 lines
/* MSGAPI test */
address CMD 'rxsubcom drop msgapi'
address CMD 'rxsubcom register MSGAPI rxmsgapi RXMSGAPI'
say rc
address CMD 'rxsubcom load MSGAPI RXMSGAPI'
say rc
address MSGAPI
'OPEN_API 3 0'
say rc
'OPEN_AREA MSG E:\msgbase\netmail MSGAREA_NORMAL SQUISH'
say rc
'LOCK MSG'
say rc
'OPEN_MSG MSGH MSG MOPEN_READ 60'
say rc
'READ_MSG MSGH XMSG. 0 17000 TEXT 1000 CONTROL'
say rc
if rc >= 0 then do
say 'Attributes:' d2x(xmsg.attr,8)
say 'From:' xmsg.from
say 'To:' XMSG.to
say 'Subject: ' XMSG.subj
say 'First 8 paragraphs:'
text = translate(text,'01'x,'0D'x)
parse var text para1 '' para2 '' para3 '' para4 '' para5 '' para6 '' para7 '' para8 '' junk
say para1
say para2
say para3
say para4
say para5
say para6
say para7
say para8
if length(junk) > 0 then say 'More text present!'
say 'First 5 Control Items:'
parse var control '' item1 '' item2 '' item3 '' item4 '' item5 ''
say item1
say item2
say item3
say item4
say item5
say 'Origin:' xmsg.orig
say 'Destination:' xmsg.dest
say 'Written on:' xmsg.date_written 'UTC'
say 'Arrived on:' xmsg.date_arrived 'UTC'
say 'Time Zone:' xmsg.utc_ofs 'minutes after UTC'
say 'This is a Reply to:' xmsg.replyto
do i = 1 to 10
say 'Message' xmsg.replies.i 'is a reply to this message'
end /* do */
end
say 'The FTSC date is' xmsg.ftsc_date
'CLOSE_MSG MSGH'
say rc
'OPEN_MSG MSGH MSG MOPEN_CREATE 0'
say rc
cr = '0d'x
text = 'Hello Mike.' cr 'This is a test message' cr cr
controla = '01'x
control = controla || 'PID RXMSGAPI'
xmsg.attr = 0
xmsg.from = 'Colin Adams'
xmsg.to = 'Mike Gove'
xmsg.subj = 'Testing RXMSGAPI'
xmsg.orig = '2:250/121.0'
xmsg.dest = '2:252/10.0'
xmsg.date_written = '1992/09/04:09:42:07'
xmsg.date_arrived = '1992/09/04:09:42:07'
xmsg.utc_ofs = 60
xmsg.replyto = 0
xmsg.replies.1 = 0
xmsg.replies.2 = 0
xmsg.replies.3 = 0
xmsg.replies.4 = 0
xmsg.replies.5 = 0
xmsg.replies.6 = 0
xmsg.replies.7 = 0
xmsg.replies.8 = 0
xmsg.replies.9 = 0
xmsg.replies.10 = 0
xmsg.ftsc_date = '04 Sep 92 09:42:07'
'WRITE_MSG MSGH 0 XMSG. TEXT' length(text) length(text) length(control) 'CONTROL'
say rc
'CLOSE_MSG MSGH'
say rc
'UNLOCK MSG'
say rc
'CLOSE_AREA MSG'
say rc
'OPEN_AREA MSG E:\MSGBASE\PUBLIC MSGAREA_NORMAL SQUISH'
say rc
'KILL_MSG MSG 1'
say rc
'CLOSE_AREA MSG'
say rc
'CLOSE_API'
say rc
address CMD 'rxsubcom drop msgapi'
say rc
call syssleep 3