mb.Message("Invalid project name", "To make a new project, you must^Mspecify a valid new project object name.")
FocusOnTE TEProjName
Exit Sub
ElseIf IsIdentifierValid(name) = 0 Then
mb.Message("Invalid project name", """" & name & """ is not a valid object name.^M^MTo make a new project, you must ^Mspecify a valid new project object name.")
FocusOnTE TEProjName
Exit Sub
ElseIf FindObject(name) Then
mb.Message("Invalid project name", "The object """ & name & """ already exists.^M^MTo make a new project, you must ^Mspecify a valid new project object name.")
FocusOnTE TEProjName
Exit Sub
End If
' Check that the specified project file can be written.
' Allow the user to continue if she really wants to.
name = TEProjFile.Text
If name = "" Then
answer = YesNoBox.Message("No project file name", "You have not specified a project file.^MDo you wish to continue anyway?")
If answer <> IDYES Then
FocusOnTE TEProjFile
Exit Sub
End If
Else
Dim file As New TextFile
file.FileName = name
If file.Exists Then
answer = YesNoBox.Message("Project file exists", "The project file you selected already exists.^MDo you wish to continue anyway?")
If answer <> IDYES Then
FocusOnTE TEProjFile
Exit Sub
End If
If file.ReadOnly Then
answer = YesNoBox.Message("Read-only project file", "The project file you selected is read-only.^MDo you wish to continue anyway?")
If answer <> IDYES Then
FocusOnTE TEProjFile
Exit Sub
End If
End If
Else
Try
file.Create(False)
Catch
End Try
If Not file.Exists Then
answer = YesNoBox.Message("Can't make project file", "Unable to make project file: " & name & ".^MDo you wish to continue anyway?")
If answer <> IDYES Then
FocusOnTE TEProjFile
Exit Sub
End If
End If
file.Delete
End If
End If
' Check that the specified EXE file can be written.
' Allow the user to continue if she really wants to.
If OptApplication.Value Then
name = TEEXEfile.Text
If name = "" Then
answer = YesNoBox.Message("No EXE file name", "You have not specified an application EXE file.^MDo you wish to continue anyway?")
If answer <> IDYES Then
FocusOnTE TEEXEfile
Exit Sub
End If
Else
Dim file As New TextFile
file.FileName = name
If file.Exists Then
answer = YesNoBox.Message("EXE file exists", "The application EXE file you selected already exists.^MDo you wish to continue anyway?")
If answer <> IDYES Then
FocusOnTE TEEXEfile
Exit Sub
End If
If file.ReadOnly Then
answer = YesNoBox.Message("Read-only EXE file", "The application EXE file you selected is read-only.^MDo you wish to continue anyway?")
If answer <> IDYES Then
FocusOnTE TEEXEfile
Exit Sub
End If
End If
Else
Try
file.Create(False)
Catch
End Try
If Not file.Exists Then
answer = YesNoBox.Message("Can't make EXE file", "Unable to make application EXE file: " & name & ".^MDo you wish to continue anyway?")
If answer <> IDYES Then
FocusOnTE TEEXEfile
Exit Sub
End If
End If
file.Delete
End If
End If
End If
Hide
ModalResult IDOK
End Sub
Function DoExecute(ByVal auto As Boolean) As Project