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

  1. Sub cancel_Click ()
  2. Unload setup
  3. If maildir = "" Then
  4.     MsgBox ("Setup Needs to Be Performed before OGMAIL Can Be Run")
  5.     End
  6. End If
  7. End Sub
  8.  
  9. Sub ok_btn_Click ()
  10.  
  11. On Error Resume Next
  12.  
  13. '
  14. ' First we verify that a user name is specified
  15. '
  16.  If usename.text = "" Then
  17.     ans% = MsgBox("No User Name Specified" + Chr$(10) + "Press Ok to Edit", 17, "OGMAIL - Setup Error")
  18.     If ans% = 1 Then
  19.         usename.SetFocus
  20.     Else
  21.         cancel_Click
  22.     End If
  23.     Exit Sub
  24.  End If
  25. '
  26. ' Now we will check to see if the postbox path is specified
  27. '
  28.  If pbox.text = "" Then
  29.     ans% = MsgBox("No Post Box Directory Specified" + Chr$(10) + "Press Ok to Edit", 17, "OGMAIL - Setup Error")
  30.     If ans% = 1 Then
  31.         pbox.SetFocus
  32.     Else
  33.         cancel_Click
  34.     End If
  35.     Exit Sub
  36.  Else
  37.         ChDir pbox.text
  38.         If Err = 76 Then
  39.             ans% = MsgBox("Post Box Directory Specified Does Not Exist" + Chr$(10) + "Press Ok to Create", 17, "OGMAIL - Setup Error")
  40.             If ans% = 1 Then
  41.                 MkDir pbox.text
  42.                 If Err > 0 Then
  43.                     ans% = MsgBox("Cannot Create Post Box Directory Specified " + Chr$(10) + "Press Ok to Edit Path", 17, "OGMAIL - Setup Error")
  44.                     If ans% = 1 Then
  45.                         pbox.SetFocus
  46.                         Exit Sub
  47.                     Else
  48.                         cancel_Click
  49.                         Exit Sub
  50.                     End If
  51.                 End If
  52.             Else
  53.                 cancel_Click
  54.                 Exit Sub
  55.             End If
  56.         End If
  57. End If
  58.  
  59. '
  60. '  Now we will save the default setup parameters to the
  61. '  ogmail.ini file
  62. '
  63.     username = usename.text
  64.     maildir = pbox.text
  65.     If (Mid$(maildir, Len(maildir), 1)) <> "\" Then
  66.         maildir = maildir + "\"
  67.     End If
  68.  
  69.     Open namefile For Output As #1
  70.  
  71.     Write #1, username
  72.     Write #1, maildir
  73.     Close #1
  74.  
  75. '
  76. '  Now we will add the current users name to the
  77. '  users file in the post box directory
  78. '
  79.     
  80.     Open maildir + "users" For Append As #7
  81.  
  82.     Write #7, username
  83.  
  84.     Close #7
  85.  
  86.     setupflag = True
  87.     Unload setup
  88.  
  89.  
  90. End Sub
  91.  
  92.  
  93.