home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / code / network / ogmess / setup.frm < prev    next >
Text File  |  1995-02-27  |  4KB  |  159 lines

  1. VERSION 2.00
  2. Begin Form setup 
  3.    AutoRedraw      =   -1  'True
  4.    Caption         =   "OGMESSAGE- Setup"
  5.    ClientHeight    =   2430
  6.    ClientLeft      =   1050
  7.    ClientTop       =   2070
  8.    ClientWidth     =   6240
  9.    Height          =   2955
  10.    Left            =   990
  11.    LinkMode        =   1  'Source
  12.    LinkTopic       =   "Form1"
  13.    MousePointer    =   1  'Arrow
  14.    ScaleHeight     =   2430
  15.    ScaleWidth      =   6240
  16.    Top             =   1605
  17.    Width           =   6360
  18.    Begin CommandButton cancel 
  19.       Cancel          =   -1  'True
  20.       Caption         =   "&Cancel"
  21.       Height          =   495
  22.       Left            =   3720
  23.       TabIndex        =   5
  24.       Top             =   1680
  25.       Width           =   1695
  26.    End
  27.    Begin CommandButton OK_btn 
  28.       Caption         =   "&Save"
  29.       Default         =   -1  'True
  30.       Height          =   495
  31.       Left            =   840
  32.       TabIndex        =   4
  33.       Top             =   1680
  34.       Width           =   1695
  35.    End
  36.    Begin TextBox pbox 
  37.       Height          =   375
  38.       Left            =   2400
  39.       TabIndex        =   3
  40.       Top             =   960
  41.       Width           =   3735
  42.    End
  43.    Begin TextBox usename 
  44.       Height          =   375
  45.       Left            =   2400
  46.       TabIndex        =   2
  47.       Top             =   360
  48.       Width           =   2415
  49.    End
  50.    Begin Label Label2 
  51.       Caption         =   "Post Box &Directory :"
  52.       Height          =   255
  53.       Left            =   240
  54.       TabIndex        =   1
  55.       Top             =   1080
  56.       Width           =   1815
  57.    End
  58.    Begin Label Label1 
  59.       Caption         =   "&User Name  :"
  60.       Height          =   255
  61.       Left            =   840
  62.       TabIndex        =   0
  63.       Top             =   360
  64.       Width           =   1455
  65.    End
  66. End
  67. Sub cancel_Click ()
  68. Unload setup
  69. If maildir = "" Then
  70.     MsgBox ("Setup Needs to Be Performed before OGMAIL Can Be Run")
  71.     End
  72. End If
  73. End Sub
  74.  
  75. Sub ok_btn_Click ()
  76.  
  77. On Error Resume Next
  78.  
  79. '
  80. ' First we verify that a user name is specified
  81. '
  82.  If usename.text = "" Then
  83.     ans% = MsgBox("No User Name Specified" + Chr$(10) + "Press Ok to Edit", 17, "OGMAIL - Setup Error")
  84.     If ans% = 1 Then
  85.         usename.SetFocus
  86.     Else
  87.         cancel_Click
  88.     End If
  89.     Exit Sub
  90.  End If
  91. '
  92. ' Now we will check to see if the postbox path is specified
  93. '
  94.  If pbox.text = "" Then
  95.     ans% = MsgBox("No Post Box Directory Specified" + Chr$(10) + "Press Ok to Edit", 17, "OGMAIL - Setup Error")
  96.     If ans% = 1 Then
  97.         pbox.SetFocus
  98.     Else
  99.         cancel_Click
  100.     End If
  101.     Exit Sub
  102.  Else
  103.         ChDir pbox.text
  104.         If Err = 76 Then
  105.             ans% = MsgBox("Post Box Directory Specified Does Not Exist" + Chr$(10) + "Press Ok to Create", 17, "OGMAIL - Setup Error")
  106.             If ans% = 1 Then
  107.                 MkDir pbox.text
  108.                 If Err > 0 Then
  109.                     ans% = MsgBox("Cannot Create Post Box Directory Specified " + Chr$(10) + "Press Ok to Edit Path", 17, "OGMAIL - Setup Error")
  110.                     If ans% = 1 Then
  111.                         pbox.SetFocus
  112.                         Exit Sub
  113.                     Else
  114.                         cancel_Click
  115.                         Exit Sub
  116.                     End If
  117.                 End If
  118.             Else
  119.                 cancel_Click
  120.                 Exit Sub
  121.             End If
  122.         End If
  123. End If
  124.  
  125. '
  126. '  Now we will save the default setup parameters to the
  127. '  ogmail.ini file
  128. '
  129.     username = usename.text
  130.     maildir = pbox.text
  131.     If (Mid$(maildir, Len(maildir), 1)) <> "\" Then
  132.         maildir = maildir + "\"
  133.     End If
  134.  
  135.     Open namefile For Output As #1
  136.  
  137.     Write #1, username
  138.     Write #1, maildir
  139.     Close #1
  140.  
  141. '
  142. '  Now we will add the current users name to the
  143. '  users file in the post box directory
  144. '
  145.     
  146.     Open maildir + "users" For Append As #7
  147.  
  148.     Write #7, username
  149.  
  150.     Close #7
  151.  
  152.     setupflag = True
  153.     Unload setup
  154.  
  155.  
  156. End Sub
  157.  
  158.  
  159.