Category : Miscellaneous Language Source Code
Archive   : PROFS.ZIP
Filename : PROF2CMS.XED

 
Output of file : PROF2CMS.XED contained in archive : PROFS.ZIP
/* REXX */
arg ifilen ifilet ifilem .

'set ctlchar ~ escape '
'set ctlchar p prot high '
'set ctlchar q prot nohigh '
'set ctlchar n noprot high '
'set ctlchar o noprot nohigh '
'set fullread on'
'set cmdline off'
'set PF04 top' /* set these PF keys to something because by default */
'set PF16 top' /* they are TABKEY which does not satisfy a READ. */

BEGIN:
filename = '________'
filetype = 'PROFSAVE'
filemode = 'A1'
'msg Then press ENTER'

DISPLAY:
'set msgline on 14 3'
'cursor screen 06 25'
'set reserved 1 high SAVE IN PERSONAL STORAGE (A-DISK) VIPS'
'set reserved 2 noh '
'set reserved 3 noh '
'set reserved 4 noh '
'set reserved 5 noh '
'set reserved 6 noh Please enter filename: ~n' ]] filename ]] '~q '
'set reserved 7 noh '
'set reserved 8 noh Please enter filetype: ~n' ]] filetype ]] '~q '
'set reserved 9 noh '
'set reserved 10 noh Please enter filemode: ~n' ]] filemode ]] '~q '
'set reserved 11 noh '
'set reserved 12 noh '
'set reserved 13 noh '
'set reserved 14 noh '
'set reserved 15 noh '
'set reserved 16 noh '
'set reserved 17 noh '
'set reserved 18 noh '
'set reserved 19 noh '
'set reserved 20 noh '
'set reserved 21 noh '
'set reserved 22 noh '
'set reserved 23 noh PF1 = Replace PF2 = Append '
'set reserved 24 noh PF9 = Help PF12 = Return'

READSCRN:
pressed = '' /* which attention key was pressed */
read all tag
do queued()
pull string
parse var string tagid . /* don't use variable name 'tag' */

select
when tagid = 'RES'
then do
parse var string tagid linenum colnum data .
if linenum = 06 & colnum = 25 then filename = data
if linenum = 08 & colnum = 25 then filetype = data
if linenum = 10 & colnum = 25 then filemode = data
end

when tagid = 'ETK' /* ENTER key was pressed */
then pressed = tagid

when tagid = 'PFK'
then do
pressed = tagid
parse var string tagid pfkeynum .
select
when pfkeynum = 12 ] pfkeynum = 24 then do
'quit'
exit
end
when pfkeynum = 1 ] pfkeynum = 2 then nop
when pfkeynum = 13 ] pfkeynum = 14 then nop
when pfkeynum = 9 ] pfkeynum = 21 then signal helpscrn
otherwise
do
'msg Use only the PF keys listed below, or the ENTER key'
signal display
end
end /* end select pfkeynum */
end /* end do 'PFK' */
otherwise nop
end /* end select tagid */
end /* end do queued() */
filename = strip(filename,b,'_')
filetype = strip(filetype,b,'_')
filemode = strip(filemode,b,'_')
if filetype = '' then filetype='PROFSAVE'
if filemode = '' then filemode='A1'
if filename = ''
then do
filename = '________'
'msg Filename is required.'
'msg Please enter filename, then press ENTER.'
signal display
end

if pressed = 'ETK'
then do
'cms set cmstype ht'
'cms list' filename filetype filemode
holdrc=rc
'cms set cmstype rt'
rc=holdrc
if rc = 0
then do /* file exists */
'msg The specified "save" file already exists in your personal storage.'
'msg Press PF1 if you want this note to replace the specified "save" file.'
'msg Press PF2 if you want this note appended to the specified "save" file.'
signal display
end
else do /* file not found */
'CMS COPY' ifilen ifilet ifilem filename filetype filemode
if rc = 0 then 'msg The requested note was saved.'
else 'msg The requested note was NOT saved; return code =' rc
signal display
end
end /* end if 'ETK' */

/* PF key was pressed */

if pfkeynum = 1 ] pfkeynum = 13
then 'CMS COPY' ifilen ifilet ifilem filename filetype filemode '(REP'

if pfkeynum = 2 ] pfkeynum = 14
then 'CMS COPY' ifilen ifilet ifilem filename filetype filemode '(APPEND'

if rc = 0 then 'msg The requested note was saved.'
else 'msg The requested note was NOT saved; return code =' rc
signal display
exit


HELPSCRN:
'set msgline on 23 2'
'cursor screen 24 63'
'set reserved 1 high SAVE IN PERSONAL STORAGE (A-DISK) VIPS'
'set reserved 2 noh '
'set reserved 3 noh '
'set reserved 4 noh This function is used to save a note into a CMS file (personal storage).'
'set reserved 5 noh This is necessary before you use the CMSREADY function to download the '
'set reserved 6 noh note to a PC. '
'set reserved 7 noh '
'set reserved 8 noh You type the name of the CMS file on the screen and press ENTER. '
'set reserved 9 noh If a CMS file by this name already exists, then you can press '
'set reserved 10 noh PF1 to write over it, or you can press PF2 to append the current '
'set reserved 11 noh note to the end of the CMS file. '
'set reserved 12 noh '
'set reserved 13 noh Actually, this function can be used to "print" anything into a CMS file'
'set reserved 14 noh rather than sending it to the printer. '
'set reserved 15 noh '
'set reserved 16 noh Note: When you invoked this function, a one-line message may have flashed'
'set reserved 17 noh momentarily across the top of the screen before the complete display.'
'set reserved 18 noh The following two messages, for example, can be ignored: '
'set reserved 19 noh '
'set reserved 20 noh EPRPRN031I The STRIP option is ignored for a DCF document '
'set reserved 21 noh DDD3113 Transformed datastream created '
'set reserved 22 noh '
'set reserved 23 noh '
'set reserved 24 noh PF12 = Return'

read all tag
pull tagid pfkeynum . /* don't use variable name 'tag' */
if tagid = 'PFK' & (pfkeynum = 12 ] pfkeynum = 24)
then signal begin
else do
'msg Use PF12 to return.'
signal helpscrn
end



  3 Responses to “Category : Miscellaneous Language Source Code
Archive   : PROFS.ZIP
Filename : PROF2CMS.XED

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/