'contains all global variables for the application
'and some routines
'
Global Const MB_YESNO = 4
Global Const MB_OKCANCEL = 1
Global Const MB_ICONQUESTION = 32
Global Const MB_DEFBUTTON2 = 256
Global Const ID_YES = 6
Global Const ID_OK = 1
Global Const ID_NO = 7
Global Const LogFileName = "QUICKFTP.LOG"
Global Dir_file As String, Temp_File As String
'
Global doitmode ' true for cycling login/FTP/logout
Global putmode ' true for put file
Global cyclemode ' true if cycling
Global HostName As String
Global userid As String
Global Password As String
'
Global Connected As Integer 'flag to indicate connection
Global OkDialog As Integer 'return variable from other forms
Global inputformdata As String'return from input form
Global Success As Integer 'return variable from Ftp functions
Global Transtype As Integer 'should be Asc("A") or Asc("I")
Global DirType As Integer 'True = long; False = short
Global MaskType As String 'default = *.* NOT IMPLEMENTED
Global Src_name As String 'source file name
Global Dest_name As String 'destination file name
Global List_Data As String 'when coming from command line option '<filename'
Global Host_File_Name As String
Global Local_File_Name As String
Global ServerDirect As String 'initial directory
Global transferaborted As Integer
Global notify As Integer
Global commandmode As Integer
Global clickindex As Integer
Global olddirclick As Integer 'for list clicking-single only
Global initialcycle As Integer
Declare Function GetTempFileName Lib "Kernel" (ByVal cDriveLetter As Integer, ByVal lpPrefixString As String, ByVal wUnique As Integer, ByVal lpTempFileName As String) As Integer
'__
'__ GLOBAL GetTempFileName
'__
'__ parameter ByVal cDriveLetter As Integer
'__ parameter ByVal lpPrefixString As String
'__ parameter ByVal wUnique As Integer
'__ parameter ByVal lpTempFileName As String
'__ called by FTP_form Form_Load
'__
Declare Function GetPrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal lpFilename As String) As Integer
'__
'__ GLOBAL GetPrivateProfileString
'__
'__ parameter ByVal lpApplicationName As String
'__ parameter ByVal lpKeyName As Any
'__ parameter ByVal lpDefault As String
'__ parameter ByVal lpReturnedString As String
'__ parameter ByVal nSize As Integer
'__ parameter ByVal lpFilename As String
'__ called by Connectform PrivateStrings
'__
Declare Function writePrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lplFileName As String) As Integer
'__
'__ GLOBAL writePrivateProfileString
'__
'__ parameter ByVal lpApplicationName As String
'__ parameter ByVal lpKeyName As Any
'__ parameter ByVal lpString As Any
'__ parameter ByVal lplFileName As String
'__ called by Connectform PrivateStrings
'__
Function DirOf (fname)
'__
'__ GLOBAL DirOf
'__
'__ parameter fname
'__
f$ = fname
DirOf = app.Path & "\"
pt = 0
For i = Len(f$) To 1 Step -1
If Mid(f$, i, 1) = "\" Or Mid(f$, i, 1) = ":" Then pt = i: Exit For
Next i
If pt > 0 Then DirOf = Left(fname, pt)
End Function
Function Get_mask_type () As String
'__
'__ GLOBAL Get_mask_type
'__ called by FTP_form Menu_setting_items_Click
'__
'
Dim Answer$, DefVal, Msg, title
'
DefVal = MaskType
Msg = "Enter file mask : "
title = "File mask"
'
Answer = InputBox$(Msg, title, DefVal)
'
Get_mask_type = Answer
'
End Function
Function getinput (prompt As String, default As String)
'__
'__ GLOBAL getinput
'__
'__ parameter prompt As String
'__ parameter default As String
'__ called by Connectform Check_info
'__ called by GLOBAL getword
'__ called by FTP_form Menu_directory_item_Click
'__
inputform.Caption = prompt
If UCase(userid) = "ANONYMOUS" And prompt = "Password" Then