home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 3 Comm
/
03-Comm.zip
/
EASL2PRF.ZIP
/
HOSTFDB.INC
< prev
next >
Wrap
Text File
|
1990-06-15
|
6KB
|
162 lines
application RECEIVEFILE
boolean HostListFound is false
string FileListLine
string ListHostFileName ListHostFileType ListHostFileMode
integer FileCtr
#
# Dialog Box Object Definition(s)
#
invisible textual region HostFileListTR
window size 80 columns 24 lines
at 10 10 in PrimaryWindow
enabled invisible modeless dialog box HostFileListDB
size 200 110
at position 78 40
dialog border
title bar "Host File Names"
system menu
enabled visible static text HostFileListST1
size 81 8
at position 28 89
in HostFileListDB
left align
top align
text "Select a Host File:"
enabled visible list box HostFileListLB
size 170 58
at position 15 27
in HostFileListDB
enabled visible default push button OK
size 38 12
at position 6 4
in HostFileListDB
group is Actions
text "~OK"
enabled visible cancel push button Cancel
size 38 12
at position 56 4
in HostFileListDB
group is Actions
text "Cancel"
#
# Subroutine Definition(s)
#
subroutine ProcessHostFileListDB( boolean : DidOKCUA ) is
begin guarded
response to start
if (not HostListFound) then
copy true to HostListFound
read file "CMS$LIST.PRN" into HostFileListTR
copy "CMS$LIST.PRN" to FileName
copy "read-only" to Access
call Open(FileID,FileName,Access)
for FileCtr = 1 to bottom of HostFileListTR loop
append "█" to InitMsg
change InitializeST text to InitMsg
call ReadLineNumber(FileID,FileCtr,FileListLine)
extract from FileListLine
skip to 8
take word ListHostFileName
take word ListHostFileType
take word ListHostFileMode
if (ListHostFileType != "OFSLOGfl") then
add to HostFileListLB
insert ListHostFileName " " ListHostFileType " " ListHostFileMode
end if
end loop
call Close(FileID)
copy "/C erase CMS$LIST.PRN\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 HostFileListDB visible
response to OK in HostFileListDB
copy true to DidOKCUA
make HostFileListDB invisible
leave block
response to Cancel in HostFileListDB
copy false to DidOKCUA
make HostFileListDB invisible
leave block
end
# This routine transfers the file
action TransferFromHost is # & calls other routines to read list
copy "Getting List of Host Files.\n" to InitMsg
change InitializeST text to InitMsg
make InitializeDB visible
action Init3270 # get the list of host files
copy "LISTF * * A (EXEC" to Keystrokes
action EnterString
action DefineWatch # wait for response
copy 60 to SettleTime
action WatchForNoX
action WatchAndWait
if (WatchGaveUp) then
# error
else
action Stop3270
# set up HostFileName and HostOptions
copy "CMS$LIST.PRN" to ChosenPCFileName
copy "CMS EXEC A " 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
call ProcessHostFileListDB(DidOKCUA)
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
end if