home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Tool Box
/
SIMS_2.iso
/
code
/
network
/
ogmess
/
setup.frm
< prev
next >
Wrap
Text File
|
1995-02-27
|
4KB
|
159 lines
VERSION 2.00
Begin Form setup
AutoRedraw = -1 'True
Caption = "OGMESSAGE- Setup"
ClientHeight = 2430
ClientLeft = 1050
ClientTop = 2070
ClientWidth = 6240
Height = 2955
Left = 990
LinkMode = 1 'Source
LinkTopic = "Form1"
MousePointer = 1 'Arrow
ScaleHeight = 2430
ScaleWidth = 6240
Top = 1605
Width = 6360
Begin CommandButton cancel
Cancel = -1 'True
Caption = "&Cancel"
Height = 495
Left = 3720
TabIndex = 5
Top = 1680
Width = 1695
End
Begin CommandButton OK_btn
Caption = "&Save"
Default = -1 'True
Height = 495
Left = 840
TabIndex = 4
Top = 1680
Width = 1695
End
Begin TextBox pbox
Height = 375
Left = 2400
TabIndex = 3
Top = 960
Width = 3735
End
Begin TextBox usename
Height = 375
Left = 2400
TabIndex = 2
Top = 360
Width = 2415
End
Begin Label Label2
Caption = "Post Box &Directory :"
Height = 255
Left = 240
TabIndex = 1
Top = 1080
Width = 1815
End
Begin Label Label1
Caption = "&User Name :"
Height = 255
Left = 840
TabIndex = 0
Top = 360
Width = 1455
End
End
Sub cancel_Click ()
Unload setup
If maildir = "" Then
MsgBox ("Setup Needs to Be Performed before OGMAIL Can Be Run")
End
End If
End Sub
Sub ok_btn_Click ()
On Error Resume Next
'
' First we verify that a user name is specified
'
If usename.text = "" Then
ans% = MsgBox("No User Name Specified" + Chr$(10) + "Press Ok to Edit", 17, "OGMAIL - Setup Error")
If ans% = 1 Then
usename.SetFocus
Else
cancel_Click
End If
Exit Sub
End If
'
' Now we will check to see if the postbox path is specified
'
If pbox.text = "" Then
ans% = MsgBox("No Post Box Directory Specified" + Chr$(10) + "Press Ok to Edit", 17, "OGMAIL - Setup Error")
If ans% = 1 Then
pbox.SetFocus
Else
cancel_Click
End If
Exit Sub
Else
ChDir pbox.text
If Err = 76 Then
ans% = MsgBox("Post Box Directory Specified Does Not Exist" + Chr$(10) + "Press Ok to Create", 17, "OGMAIL - Setup Error")
If ans% = 1 Then
MkDir pbox.text
If Err > 0 Then
ans% = MsgBox("Cannot Create Post Box Directory Specified " + Chr$(10) + "Press Ok to Edit Path", 17, "OGMAIL - Setup Error")
If ans% = 1 Then
pbox.SetFocus
Exit Sub
Else
cancel_Click
Exit Sub
End If
End If
Else
cancel_Click
Exit Sub
End If
End If
End If
'
' Now we will save the default setup parameters to the
' ogmail.ini file
'
username = usename.text
maildir = pbox.text
If (Mid$(maildir, Len(maildir), 1)) <> "\" Then
maildir = maildir + "\"
End If
Open namefile For Output As #1
Write #1, username
Write #1, maildir
Close #1
'
' Now we will add the current users name to the
' users file in the post box directory
'
Open maildir + "users" For Append As #7
Write #7, username
Close #7
setupflag = True
Unload setup
End Sub