home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 3 Comm
/
03-Comm.zip
/
EASL2PRF.ZIP
/
PROFSEND.OLD
< prev
next >
Wrap
Text File
|
1990-03-20
|
28KB
|
724 lines
#
# Generated by Layout/CUA
# (Layout/CUA COPYRIGHT (C) INTERACTIVE IMAGES, INC. 1989. ALL RIGHTS
# RESERVED)
# Code generated on TUESDAY JANUARY 23, 1990 at TIME 15:44:47
#
boolean variable DidOKCUA Last_Dir
boolean BuiltDirListDB is false
string FileNameX FileName FileExt DirName DirExt TestName CD_DirName DirLast
string CurrDirList Temp1 is "" T_Char TempX
string ChosenPCFileName
string ChosenPCFileNameX
string HostFileName SendCommand HostOptions
string PCFileName1 PCFileNameExt
string Parms ChangeToDisk Slash CurrDirListX AscOrBin DocMsg PROFSDocNum
string MailUserName[10] Cron1 Cron2 FTErrorMsg RetCode
integer PCListName Last_Char is 1
integer X_Ctr LastSlash
integer NumDisks BytesTransmitted
#
# Dialog Box Object Definition(s)
#
include putinpr.inc
include mailscr.inc
include hostfdb.inc
include chprofs.inc
include fromprof.inc
enabled invisible modal dialog box UserIDDB
size 200 98
at position 94 45
dialog border
title bar "User Information"
system menu
enabled visible static text UserIDST
size 36 8
at position 24 63
in UserIDDB
right align
top align
text "User ID:"
enabled visible entry field UserIDEF
size 70 12
at position 64 63
in UserIDDB
text size 8 columns
left align
enabled visible static text PassWordST
size 48 8
at position 16 47
in UserIDDB
right align
top align
text "Password:"
disabled visible entry field PassWordHiddenEF
size 68 12
at position 66 47
in UserIDDB
text size 30 columns
left align
enabled visible entry field PassWordEF
size 2 12
at position 66 47
in UserIDDB
text size 8 columns
left align
enabled visible default push button OK
size 38 12
at position 6 4
in UserIDDB
group is Actions
text "~OK"
enabled visible cancel push button Cancel
size 38 12
at position 56 4
in UserIDDB
group is Actions
text "Cancel"
enabled invisible modal dialog box ChooseFileDB
size 268 110
at position 48 31
dialog border
title bar "Choose A File"
system menu
enabled visible static text DiskDriveST
size 26 8
at position 10 88
in ChooseFileDB
left align
top align
word wrap
text "Drive"
enabled visible static text CurrDirST
size 180 8
at position 85 98
in ChooseFileDB
left align
top align
word wrap
enabled visible static text Curr_DirST
size 79 8
at position 6 98
in ChooseFileDB
left align
top align
word wrap
text "Current Directory: "
enabled visible static text DirectoryST
size 48 8
at position 60 89
in ChooseFileDB
left align
top align
text "Directory"
enabled visible static text PCFileNameST
size 48 8
at position 140 88
in ChooseFileDB
left align
top align
word wrap
text "PC File Name"
enabled visible list box DiskDriveLB
size 40 49
at position 10 35
in ChooseFileDB
parameter is "disk$d.prn"
enabled visible list box DirListLB
size 72 56
at position 60 28
in ChooseFileDB
parameter is "dir$list.prn"
sort ascending
enabled visible list box PCFileLF
size 130 56
at position 136 28
in ChooseFileDB
parameter is "pc$list.prn"
sort ascending
enabled visible default push button OK
size 38 12
at position 6 4
in ChooseFileDB
group is Actions
text "~OK"
enabled visible cancel push button Cancel
size 38 12
at position 56 4
in ChooseFileDB
group is Actions
text "Cancel"
enabled invisible modal dialog box BytesSentDB
size 200 60
at position 48 60
dialog border
title bar "File Transfer Messages"
enabled visible static text BytesSentST
size 150 40
at position 10 5
in BytesSentDB
left align
top align
word wrap
enabled invisible modal dialog box InitializeDB
size 200 60
at position 48 60
dialog border
enabled visible static text InitializeST
size 150 40
at position 10 5
in InitializeDB
left align
top align
word wrap
#
# Subroutine Definition(s)
#
subroutine PutINPROFS(string:HostFileName) is
copy "Putting File in PROFS \n█" to DocMsg
change BytesSentST text to DocMsg
make BytesSentDB visible
action Init3270 # issue the store in PROFS Command
copy "EPQPCPRF " HostFileName " A " AscOrBin to Keystrokes
action EnterString
action DefineWatch # wait for response from EPQPCPRF
copy 1 to WatchRow
copy 1 to WatchCol
copy "EPQFROM" to WatchChar
action WatchForChar
action WatchAndWait
if (WatchGaveUp) then
# error
else
append "█" to DocMsg
change BytesSentST text to DocMsg
make BytesSentDB visible
copy (text of FromEF) to Keystrokes # pass the store parameters to
action EnterString # the PROFS screen
copy (text of ToEF) to Keystrokes
action EnterString
copy (text of SubjectEF) to Keystrokes
action EnterString
copy "DB FILE - " HostFileName " A" to Keystrokes
action EnterString
action DefineWatch # look for EPQPCPRF panel
copy "EPQPCPRF" to WatchChar # which tells us the result of
copy 2 to WatchCol # the document storage function.
copy 1 to WatchRow # the panel will display the return
copy 100 to SettleTime # code and document number
action WatchForChar
action WatchForNoX
action WatchAndWait
if (WatchGaveUp) then
# error
else
append "█" to DocMsg
change BytesSentST text to DocMsg
make BytesSentDB visible
action ScanScreen
copy 29 to FieldNumber # get Document Number assigned
action ReadField
copy "Store in PROFS Complete.\n" to DocMsg
append "Doc Number: " FieldText to DocMsg
copy FieldText to PROFSDocNum
copy "EPQGO" to Keystrokes # tell EPQPCPRF goodbye
action EnterString
make BytesSentDB invisible
end if
end if
action Stop3270 # Stop the 3270 stuff
subroutine MailPROFS(string:PROFSDocNum) is
copy false to DidOKCUA
call ProcessPROFSMailDocDB(DidOKCUA)
extract from PROFSDocNum # break down Doc num into two parts for mailing
take 8 Cron1
take 4 Cron2
if (DidOKCUA) then # build PROFS mail document command
action Init3270 # build command
copy "PROFS MAIL NOTICE " Cron1 " " Cron2 " TO " to Keystrokes
append " " text of UserName1EF to Keystrokes # pick up all the
append " " text of UserName2EF to Keystrokes # user ids entered
append " " text of UserName3EF to Keystrokes
append " " text of UserName4EF to Keystrokes
append " " text of UserName5EF to Keystrokes
append " " text of UserName6EF to Keystrokes
append " " text of UserName7EF to Keystrokes
append " " text of UserName8EF to Keystrokes
append " " text of UserName9EF to Keystrokes
append " " text of UserName10EF to Keystrokes
action EnterString
end if
action Stop3270
subroutine MailNonPROFS(string:HostFileName) is # Uses SENDFILE to mail
string NewHostFileName # mail the file
copy false to DidOKCUA # and then erases the
call ProcessPROFSMailDocDB(DidOKCUA) # file from the A disk
copy HostFileName to NewHostFileName
append " A " to NewHostFileName
if (DidOKCUA) then
action Init3270 # build sendfile command
copy "SENDFILE " NewHostFileName " TO " to Keystrokes
append " " text of UserName1EF to Keystrokes # pick up all the
append " " text of UserName2EF to Keystrokes # user ids entered
append " " text of UserName3EF to Keystrokes
append " " text of UserName4EF to Keystrokes
append " " text of UserName5EF to Keystrokes
append " " text of UserName6EF to Keystrokes
append " " text of UserName7EF to Keystrokes
append " " text of UserName8EF to Keystrokes
append " " text of UserName9EF to Keystrokes
append " " text of UserName10EF to Keystrokes
append " (NOT NOL " to Keystrokes # append the flags
action EnterString
end if
action DefineWatch # wait for main menu to reappear
copy 100 to SettleTime
action WatchForNoX
action WatchAndWait
if (WatchGaveUp) then
# error
else # erase the host file
copy "ERASE " NewHostFileName to Keystrokes
action EnterString
end if
action Stop3270
subroutine Change_ChooseFileDB(string:DirListX) is
string DirList # This redisplays the Directory
set pointer to SPTR_WAIT
make DirListLB invisible # and PC file list boxes after
make PCFileLF invisible # filling them in from the local
clear DirListLB # command processor
clear PCFileLF
extract from DirListX # strip off blanks at end of name
take word DirList
send "CD " DirList "\n" to DIRLIST
# send "DIR *.\n" to DIRLIST # get the list of directories
# begin guarded
# response to line "File(s)" from DIRLIST
# leave block
# response to line from DIRLIST
# extract from input
# take to 9 DirName
# skip to word
# take word DirExt
# if (DirExt = "<DIR>") then
# add to DirListLB
# insert DirName
# end if
# end
if (DirList = "..") then # User choose to move back one directory
set pointer to SPTR_WAIT
# take all but last directory on list # this routine looks
copy length of CurrDirList to X_Ctr # at the current path
copy true to Last_Dir # that has been built
while ((X_Ctr >= 1) and (Last_Dir)) loop # up for the user and
extract from CurrDirList # deletes the last
skip to X_Ctr # directory entry
take -1 T_Char
if (T_Char = "\\") then
copy marker to Last_Char
copy false to Last_Dir
end if
copy (X_Ctr - 1) to X_Ctr
end loop
extract from CurrDirList
take to Last_Char Temp1
copy Temp1 to CurrDirList
change CurrDirST text to CurrDirList # delete one item from CurrDirST
else
if ((DirList = ".") or (DirList = "")) then # redisplay current Directory
copy "" to T_Char
else # add the new directory name to
append "\\" to CurrDirList # the path the user has been building
append DirList to CurrDirList
make CurrDirST invisible
change CurrDirST text to CurrDirList
make CurrDirST visible
end if
end if
set pointer to SPTR_ARROW
set pointer to SPTR_WAIT
send "DIR *.* \n" to DIRLIST # get the list of PC files in the
begin guarded # current Directory
response to line "File(s)" from DIRLIST # end of the
leave block # command.
response to line "DIR *.*" from DIRLIST # ignore this
# do nothing
response to line "IBM Operating" from DIRLIST # ignore this
# do nothing
response to line "<DIR>" from DIRLIST # add directories to lb
extract from input
take to 9 DirName
skip to word
take word DirExt
if (DirExt = "<DIR>") then
add to DirListLB
insert DirName
end if
response to line from DIRLIST # here is a line from the
extract from input # listing
take to 9 FileNameX
skip to 10 # parse out the name and ext
take 3 FileExt
extract from FileNameX # see if the first character
take 1 TestName # is blank.
extract from FileNameX # parse out PC file name
take word FileName
if ((TestName != "") and (TestName != ".") and (TestName != " ")) then
add to PCFileLF # must have a valid
insert FileName "." FileExt # PC file Name
end if
end
make DirListLB visible # display the directory listing
make PCFileLF visible # display the PC file names listing
set pointer to SPTR_ARROW
subroutine SetupChooseFileDB( integer : PCListName ) is
start local DIRLIST "cmd.exe" # set up the DB the first time
send "CD\n" to DIRLIST
set pointer to SPTR_WAIT
begin guarded # Get Current Working Directory
response to line "[" from DIRLIST # ignore [C:] lines
# do nothing
response to line ":\\" from DIRLIST # get current directory
copy input to TempX # from the command
leave block
end
extract from TempX
take word CurrDirList
extract from CurrDirList
skip to last
take -1 T_Char
if (T_Char = "\\") then
copy marker to Last_Char
extract from CurrDirList
take to Last_Char Temp1
copy Temp1 to CurrDirList
end if
change CurrDirST text to CurrDirList
copy " " to CD_DirName
set pointer to SPTR_ARROW
call Change_ChooseFileDB(CD_DirName) # display the list of files
select line 1 in PCFileLF in ChooseFileDB # hilite pc file name
copy true to BuiltDirListDB
subroutine ProcessChooseFileDB( boolean : DidOKCUA ) is
begin guarded # DB is displayed and user is making
response to start # selections
make ChooseFileDB visible
response to DiskDriveLB # User clicked on Disk Drive LB
if (eventnumber = 17) then # only respond to Second Click
set pointer to SPTR_WAIT
turn trace on
copy textual line (selected line from DiskDriveLB) from DiskDriveLB to ChangeToDisk
send ChangeToDisk "\n" to DIRLIST
copy 1 to PCListName
send "CD\n" to DIRLIST
begin guarded # Get Current Working Directory
response to line "[" from DIRLIST
# do nothing
response to line ":\\" from DIRLIST
copy input to TempX
leave block
end
extract from TempX # go char by char looking
take word CurrDirList # for first backslash
take -1 Slash
if (Slash = "\\") then
copy marker to LastSlash # get position of backslash
extract from CurrDirList
take to LastSlash CurrDirListX
copy CurrDirListX to CurrDirList
end if
turn trace off
change CurrDirST text to CurrDirList
copy " " to CD_DirName
set pointer to SPTR_ARROW
call Change_ChooseFileDB(CD_DirName)
make ChooseFileDB visible
end if
response to DirListLB # User clicked on Dir List LB
if (eventnumber = 17) then # only respond to Second Click
set pointer to SPTR_WAIT
copy textual line (selected line from DirListLB) from DirListLB to CD_DirName
call Change_ChooseFileDB(CD_DirName)
make ChooseFileDB visible
set pointer to SPTR_ARROW
end if
response to PCFileLF # User clicked on PC file LB
if (eventnumber = 17) then # only respond to Second Click
copy true to DidOKCUA
make ChooseFileDB invisible
leave block
end if
response to OK in ChooseFileDB
copy true to DidOKCUA
make ChooseFileDB invisible
leave block
response to Cancel in ChooseFileDB
copy false to DidOKCUA
make ChooseFileDB invisible
leave block
end
subroutine QueryChooseFileDB( integer : PCListName ) is
copy ( selected line from PCFileLF in ChooseFileDB ) to PCListName
subroutine SetupTransferFileDB( integer : PCListName ) is
copy CurrDirList to ChosenPCFileName # set up DB and display defaults
append "\\" to ChosenPCFileName # get PC file name user clicked on
append textual line PCListName from PCFileLF to ChosenPCFileName
copy textual line PCListName from PCFileLF to ChosenPCFileNameX
change ChosenFileST text to ChosenPCFileName
extract from ChosenPCFileNameX # break up PC file name
take to "." PCFileName1
skip "."
take to last PCFileNameExt
if (PCFileNameExt= "RFT") then
uncheck ChangeFormat # default check box selection
else
check ChangeFormat
end if
subroutine ProcessTransferFileDB( boolean : DidOKCUA ) is
begin guarded # user is in DB
response to start
make TransferFileDB visible
response to PutInPROFS in TransferFileDB # Clicked on Put In PROFS
if (PutInPROFS is checked) then # since file is going into
make FromST visible # PROFS Storage, show user
make ToST visible # the mail log info and let
make SubjectST visible # them fill it in
make FromEF visible
make ToEF visible
make SubjectEF visible
enable FromEF
enable ToEF
enable SubjectEF
else
make FromST invisible # if not putting file in PROFS
make ToST invisible # then we don't need the mail
make SubjectST invisible # log stuff, so hide it
make FromEF invisible
make ToEF invisible
make SubjectEF invisible
disable FromEF
disable ToEF
disable SubjectEF
end if
response to OK in TransferFileDB
copy true to DidOKCUA
make TransferFileDB invisible
leave block
response to Cancel in TransferFileDB
copy false to DidOKCUA
make TransferFileDB invisible
leave block
end
subroutine SetupUserIDDB( string : UserID, string : PassWordHidden,
string : PassWord ) is # show logon DB
change UserIDEF in UserIDDB text to UserID
change PassWordHiddenEF in UserIDDB text to PassWordHidden
change PassWordEF in UserIDDB text to PassWord
subroutine ProcessUserIDDB( boolean : DidOKCUA ) is
begin guarded
response to start
make UserIDDB visible
response to OK in UserIDDB
copy true to DidOKCUA
make UserIDDB invisible
leave block
response to Cancel in UserIDDB
copy false to DidOKCUA
make UserIDDB invisible
leave block
response to PassWordEF
action HidePW
end
subroutine QueryUserIDDB( string : UserID, string : PassWordHidden,
string : PassWord ) is
copy text of UserIDEF in UserIDDB to UserID
copy text of PassWordHiddenEF in UserIDDB to PassWordHidden
copy text of PassWordEF in UserIDDB to PassWord
#
# Action Subroutines
#
# This routine transfers the file
action TransferFile is # & calls other routines to put in PROFS
set pointer to SPTR_WAIT
# set up HostFileName and HostOptions
extract from ChosenPCFileNameX # break up PC file name
take to "." PCFileName1
skip "."
take to last PCFileNameExt
copy PCFileName1 to HostFileName # build the host name VM Style
append " " PCFileNameExt to HostFileName
if (ChangeFormat is checked) then
copy " (ASCII CRLF LRECL 255 RECFM V" to HostOptions
# if converting to EBCDIC
copy "11" to AscOrBin # set the options for File Transfer
else # 11 means ASCII file for EPQPCPRF
copy " (LRECL 2048 RECFM V" to HostOptions
# not converting, so use these options
copy "10" to AscOrBin # 10 means binary file for EPQPCPRF
end if
# 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 SEND command
# it for file transfer
copy "/C start \"SendFile\" /C send " SendCommand to Parms
start local SENDFILE "cmd.exe" Parms
copy "Transmitting file: " ChosenPCFileNameX "\n█" to DocMsg
change BytesSentST text to DocMsg
make BytesSentDB visible
begin # respond to messages from
# the SEND command
response to char "File transfer is complete." from SENDFILE
set pointer to SPTR_ARROW
make BytesSentDB invisible # Send is done
if (PutInPROFS is checked) then
call PutINPROFS(HostFileName) # now put in PROFS
if (ReplyToMessage(" ","Mail the Document?",MessageYesNo,1,MessageIconQuestion)="yes") then
call MailPROFS(PROFSDocNum) # mail & erase document
copy ReplyToMessage(" ",DocMsg,MessageOK,1,MessageIconExclamation) to TempX
else
# don't mail document
copy ReplyToMessage(" ",DocMsg,MessageOK,1,MessageIconExclamation) to TempX
end if
else
if (ReplyToMessage(" ","Transfer Complete.\nMail the File?",MessageYesNo,1,MessageIconQuestion)="yes") then
# Mail nonProfs File
call MailNonPROFS(HostFileName)
end if
end if
stop SENDFILE
leave block
response to char "TRANS" from SENDFILE # bad message from SEND
begin guarded
response to char "." from SENDFILE
extract from input
take number RetCode
skip by 2
take to last FTErrorMsg
leave block
end
set pointer to SPTR_ARROW
copy "File Tranfer Error.\nTRANS" RetCode " " FTErrorMsg to DocMsg
copy ReplyToMessage(" ",DocMsg,MessageOK,1,MessageIconExclamation) to TempX
stop SENDFILE
leave block
response to line from SENDFILE
append "█" to DocMsg
change BytesSentST text to DocMsg
make BytesSentDB visible
end
set pointer to SPTR_ARROW
make BytesSentDB invisible
#
# Response Definition(s)
#
response to item Send from PrimaryWindowABCUA
copy false to DidOKCUA
call ProcessChooseFileDB( DidOKCUA ) # jump user into box
if ( DidOKCUA ) then # return from box
call QueryChooseFileDB( PCListName ) # see what user did
call SetupTransferFileDB ( PCListName ) # call file transfer setup
copy false to DidOKCUA
call ProcessTransferFileDB ( DidOKCUA ) # show File Transfer DB
if ( DidOKCUA ) then # start file transfer
action TransferFile
end if
end if
response to item Receive from PrimaryWindowABCUA
copy false to DidOKCUA
call ProcessChooseFileLocationDB(DidOKCUA)
if (DidOKCUA) then
if (GetFileFromStorageRB is checked) then
if (not HostListFound) then
copy false to DidOKCUA
action TransferFromHost
else
copy false to DidOKCUA
call ProcessHostFileListDB(DidOKCUA)
end if
else
if (not PROFSListFound) then
action TransferFromPROFS
copy false to DidOKCUA
call ProcessPROFSFileListDB(DidOKCUA)
if (DidOKCUA) then
action GetPROFSDoc
end if
else
copy false to DidOKCUA
call ProcessPROFSFileListDB(DidOKCUA)
if (DidOKCUA) then
action GetPROFSDoc
end if
end if
end if
end if
response to item Logoff from PrimaryWindowABCUA
action LogOffPROFS
response to item Logon from PrimaryWindowABCUA
copy "" to UserID
copy "" to PassWord
copy "" to PassWordHidden
call SetupUserIDDB(UserID,PassWordHidden,PassWord)
make UserIDDB visible
copy false to DidOKCUA
call ProcessUserIDDB(DidOKCUA)
if (DidOKCUA) then
call QueryUserIDDB(UserID,PassWordHidden,PassWord)
action LogonToPROFS
end if
response to item ExitCUA from PrimaryWindowABCUA
exit