home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 3 Comm
/
03-Comm.zip
/
EASL2PRF.ZIP
/
FROMPROF.INC
< prev
next >
Wrap
Text File
|
1990-06-15
|
13KB
|
325 lines
boolean PROFSListFound is false AsciiFlag is false
integer PROFCtr DocIndex
string PROFSDocNumber[254]
string PROFSFrom RFTTest
string PROFSTo TempString
string PROFSSubject[254]
string PROFSIndexLine
#
# Dialog Box Object Definition(s)
#
invisible textual region PROFSFileListTR
window size 80 columns 24 lines
at 10 10 in PrimaryWindow
enabled invisible modeless dialog box PROFSFileListDB
size 300 150
at position 78 40
dialog border
title bar "PROFS Documents"
system menu
enabled visible static text PROFSFileListST1
size 140 8
at position 15 130
in PROFSFileListDB
left align
top align
text "Select a PROFS Document:"
enabled visible list box PROFSFileListLB
size 250 100
at position 15 27
in PROFSFileListDB
enabled visible default push button OK
size 38 12
at position 6 4
in PROFSFileListDB
group is Actions
text "~OK"
enabled visible cancel push button Cancel
size 38 12
at position 56 4
in PROFSFileListDB
group is Actions
text "Cancel"
enabled invisible modal dialog box GetPROFSFileDB
size 264 110
at position 50 40
dialog border
title bar "Specify PC File Name"
system menu
enabled visible static text GetPROFSHostFileNameST
size 198 8
at position 12 83
in GetPROFSFileDB
left align
top align
text "Host File Name:"
enabled visible static text GetPROFSPCFileNameST
size 86 8
at position 11 59
in GetPROFSFileDB
right align
top align
text "Enter PC File Name:"
enabled visible entry field GetPROFSPCFileNameEF
size 150 12
at position 102 57
in GetPROFSFileDB
text size 30 columns
left align
enabled visible default push button OK
size 38 12
at position 6 4
in GetPROFSFileDB
group is Actions
text "~OK"
enabled visible cancel push button Cancel
size 38 12
at position 56 4
in GetPROFSFileDB
group is Actions
text "Cancel"
#
# Subroutine Definition(s)
#
subroutine ProcessGetPROFSFileDB( boolean : DidOKCUA ) is
begin guarded
response to start
make GetPROFSFileDB visible
response to OK in GetPROFSFileDB
copy true to DidOKCUA
make GetPROFSFileDB invisible
leave block
response to Cancel in GetPROFSFileDB
copy false to DidOKCUA
make GetPROFSFileDB invisible
leave block
end
#
# Subroutine Definition(s)
#
subroutine ProcessPROFSFileListDB( boolean : DidOKCUA ) is
begin guarded
response to start
if (not PROFSListFound) then
copy true to PROFSListFound
clear PROFSFileListTR
read file "OFSINDEX.OFD" into PROFSFileListTR
copy "OFSINDEX.OFD" to FileName
copy "read-only" to Access
call Open(FileID, FileName, Access)
for PROFCtr = 1 to (bottom of PROFSFileListTR)loop
append "█" to InitMsg
change InitializeST text to InitMsg
call ReadLineNumber(FileID,PROFCtr,PROFSIndexLine)
extract from PROFSIndexLine
take 12 PROFSDocNumber[PROFCtr]
skip to 66
take to 120 PROFSSubject[PROFCtr]
if (PROFSSubject[PROFCtr] = " ") then
copy "NO SUBJECT" to PROFSSubject[PROFCtr]
end if
add to PROFSFileListLB
insert PROFSSubject[PROFCtr] # PROFSDocNumber[PROFCtr]
end loop
call Close(FileID)
copy "/C erase OFSINDEX.OFD\n" to Parms
start local RECEIVEFILE "cmd.exe" Parms
begin
response to line "IBM Operating" from RECEIVEFILE
# do nothing
response to line "<DIR>" from RECEIVEFILE
# do nothing
response to line "ERASE" from RECEIVEFILE
# do nothing
response to timeout 1
leave block
end
stop RECEIVEFILE
end if
make InitializeDB invisible
make PROFSFileListDB visible
response to OK in PROFSFileListDB
copy true to DidOKCUA
make PROFSFileListDB invisible
leave block
response to Cancel in PROFSFileListDB
copy false to DidOKCUA
make PROFSFileListDB invisible
leave block
end
# This routine transfers the file
action TransferFromPROFS is # & calls other routines to read list
set pointer to SPTR_WAIT
copy "Getting List of PROFS Documents.\n" to InitMsg
change InitializeST text to InitMsg
make InitializeDB visible
# set up HostFileName and HostOptions
copy "OFSINDEX.OFD" to ChosenPCFileName
copy "OFSINDEX OFSDATA " to HostFileName # build the host name VM Style
copy " (ASCII CRLF" to HostOptions # converting to ASCII
# build send command
copy ChosenPCFileName to SendCommand
append " " HostFileName to SendCommand
append " " HostOptions to SendCommand
# get ready to start a
# command processor and
# pass the RECEIVE command
# it for file transfer
copy "/C start \"ReceiveFile\" /C receive " SendCommand to Parms
start local RECEIVEFILE "cmd.exe" Parms
begin # respond to messages from
# the SEND command
response to char "File transfer is complete." from RECEIVEFILE
# add to list box
copy false to DidOKCUA
stop RECEIVEFILE
leave block
response to line "TRANS03" from RECEIVEFILE
copy ReplyToMessage(" ","File Transfer Complete",MessageOK,1,MessageIconExclamation) to TempX
stop RECEIVEFILE
leave block
response to line "TRANS026" from RECEIVEFILE # bad message from SEND
copy ReplyToMessage(" ","File Transfer returned message TRANS026",MessageOK,1,MessageIconExclamation) to TempX
stop RECEIVEFILE
leave block
response to char "Number of" from RECEIVEFILE
append "█" to InitMsg
change InitializeST text to InitMsg
response to timeout 60 # from RECEIVEFILE
copy ReplyToMessage(" ","File Transfer Timed Out.",MessageOK,1,MessageIconExclamation) to TempX
stop RECEIVEFILE
leave block
end
set pointer to SPTR_ARROW
action GetPROFSFile is
set pointer to SPTR_WAIT
copy "Getting PROFS Document.\n" to InitMsg
change InitializeST text to InitMsg
make InitializeDB visible
# set up HostFileName and HostOptions
# build send command
copy ChosenPCFileName to SendCommand
append " " HostFileName to SendCommand
append " " HostOptions to SendCommand
# get ready to start a
# command processor and
# pass the RECEIVE command
# it for file transfer
copy "/C start \"ReceiveFile\" /C receive " SendCommand to Parms
start local RECEIVEFILE "cmd.exe" Parms
begin # respond to messages from
# the SEND command
response to char "File transfer is complete." from RECEIVEFILE
stop RECEIVEFILE
make InitializeDB invisible
copy ReplyToMessage(ChosenPCFileName,"File Transfer Complete",MessageOK,1,MessageIconExclamation) to TempX
leave block
response to line "TRANS03" from RECEIVEFILE
stop RECEIVEFILE
make InitializeDB invisible
copy ReplyToMessage(ChosenPCFileName,"File Transfer Complete",MessageOK,1,MessageIconExclamation) to TempX
leave block
response to line "TRANS026" from RECEIVEFILE # bad message from SEND
stop RECEIVEFILE
make InitializeDB invisible
copy ReplyToMessage(" ","File Transfer returned message TRANS026",MessageOK,1,MessageIconExclamation) to TempX
leave block
response to char "Number of" from RECEIVEFILE
append "█" to InitMsg
change InitializeST text to InitMsg
response to timeout 60 # from RECEIVEFILE
copy ReplyToMessage(" ","File Transfer Timed Out.",MessageOK,1,MessageIconExclamation) to TempX
stop RECEIVEFILE
leave block
end
set pointer to SPTR_ARROW
action GetPROFSDoc is
set pointer to SPTR_WAIT
action Init3270
copy selected line from PROFSFileListLB to DocIndex
copy "PRGFRPRF " to Keystrokes
append PROFSDocNumber[DocIndex] to Keystrokes
action EnterString
action DefineWatch # wait for response from EPQPCPRF
copy 22 to WatchRow
copy 2 to WatchCol
copy "PF12=END" to WatchChar
copy 300 to SettleTime
action WatchForChar
action WatchForNoX
action WatchAndWait
if (WatchGaveUp) then
set pointer to SPTR_ARROW
# error
else
# we made it to the download screen. read screen variables
# that will be used for downloading.
action ScanScreen
copy 13 to FieldNumber # Host File Name
action ReadField
copy FieldText to HostFileName
copy 16 to FieldNumber # Host File Type
action ReadField
append " " FieldText to HostFileName
extract from FieldText
take 3 RFTTest
if (RFTTest = "RFT") then
copy false to AsciiFlag
else
copy true to AsciiFlag
end if
# we have the name of the Host File, now we need the name
# of the PC file. Call a Dialog Box for this info
copy text of GetPROFSHostFileNameST to TempString
append " " HostFileName to TempString
change GetPROFSHostFileNameST text to TempString
set pointer to SPTR_ARROW
copy false to DidOKCUA
call ProcessGetPROFSFileDB (DidOKCUA)
if (DidOKCUA) then
copy text of GetPROFSPCFileNameEF to ChosenPCFileName
# get the host file mode and complete the download request
copy 19 to FieldNumber # Host File Mode
action ReadField
append " " FieldText to HostFileName
if (AsciiFlag) then
copy " (ASCII CRLF" to HostOptions
else
copy " " to HostOptions
end if
action Stop3270
action GetPROFSFile
end if
# clear out the host screen
action Init3270
copy 12 to PFkeyNumber
action PressPFkey
action Stop3270
end if