Курсовая работа: Программирование в Бейсике
Command1.Enabled
= True: Command2.Enabled = True: Command3.Enabled = True: Command7.Enabled =
True
Command5.Enabled
= True
Mis
= Combo1.ListIndex
If
Len(Dir("c:\Курсовая моя\" + Combo1.List(Mis) + ".txt")) = 0 Then
MsgBox "Файл
маршрута не найден" + vbCrLf + _
"Проверьте
его наличие: 'c:\Курсовая моя\" + Combo1.List(Mis) + ".txt'"
Exit
Sub
Else
Files
End
If
For
i = 0 To arBusCount(Mis) - 1
Combo2.AddItem
arBusNumber(Mis, i)
Next
i
For
i = 0 To 35
Image1(i).Picture
= LoadPicture("c:\Курсовая моя\Иконки\Icon2.ico")
Next
i
Picture1.Cls
For
i = 1 To 35
Me.Image1(i).Visible
= False
Me.Label14(i).Visible
= False
Next
i
Me.Picture1.PSet
(arStayAbsciss(Mis, 0), arStayOrdinata(Mis, 0))
w =
Me.Image1(0).Width / 2
Me.Image1(0).Move
arStayAbsciss(Mis, 0) - w, arStayOrdinata(Mis, 0) - w
Me.Label14(0).Move
Image1(0).Left + 2 * w, Image1(0).Top
Me.Label14(0).Caption
= arStayName(Mis, 0)
For
i = 0 To (arStayCount(Mis) - 1)
Me.Picture1.Line
-(arStayAbsciss(Mis, i), arStayOrdinata(Mis, i))
Me.Image1(i).Move
arStayAbsciss(Mis, i) - w, arStayOrdinata(Mis, i) - w
Me.Image1(i).Visible
= True
Me.Label14(i).Visible
= True
Me.Label14(i).Move
Image1(i).Left + 2 * w, Image1(i).Top
Me.Label14(i).Caption
= arStayName(Mis, i)
Me.Combo4.AddItem
arStayName(Mis, i)
Next
i
End
Sub
Private
Sub Combo2_Click()
DooM
= False
Text2.Enabled
= True: Text3.Enabled = True
Me.Command8.Enabled
= True
Misk
= Combo2.ListIndex
Text1.Text
= arBusNumber(Mis, Misk)
Text2.Text
= arDriveName(Mis, Misk)
Text3.Text
= arConductorName(Mis, Misk)
End
Sub
Private
Sub Combo3_Click()
DooM
= True
Text2.Enabled
= True: Text3.Enabled = True
Mi =
Combo3.ListIndex
Text1.Text
= Combo3.List(Mi)
Text2.Text
= ""
Text3.Text
= ""
End
Sub
Private
Sub Combo4_Click()
disk
= Combo4.ListIndex
Text4.Enabled
= True
Text4.Text
= Combo4.List(disk)
For
i = 0 To 35
If
Label14(i).Caption = Combo4.List(disk) Then
Image1(i).Picture
= LoadPicture("c:\Курсовая моя\Иконки\!conMania.cur")
Else
Image1(i).Picture
= LoadPicture("c:\ Курсовая моя\Иконки \Icon2.ico")
End
If
Next
i
End
Sub
Private
Sub Combo5_Click()
zxz
= Combo5.ListIndex
Text7.Text
= Combo5.List(zxz)
Text6.Text
= ""
Text5.Text
= ""
Command11.Enabled
= True
Text5.Enabled
= True
Text6.Enabled
= True
End
Sub
Private
Sub Combo7_Click()
Text9.Enabled
= True
Text9.Text
= nama(LinesCount - 1, Combo7.ListIndex)
End
Sub
Private
Sub Command1_Click()
If Len(Dir("c:\Курсовая
моя\Свободные автобусы.txt")) = 0 Then
MsgBox "Файл
свободных автобусов не найден!!!" + vbCrLf + _
"Проверьте
его наличие : 'c:\ Курсовая моя\Свободные автобусы.txt'"
Exit
Sub
End
If
Combo3.Enabled
= True
i = 0
Open "c:\ Курсовая
моя\Свободные автобусы.txt" For Input As 3
Do
While Not EOF(3)
Input
#3, arFreeBuses(i)
Combo3.AddItem
arFreeBuses(i)
i =
i + 1
Loop
Close
3
End
Sub
Private
Sub Command10_Click()
If Command10.Caption = "Начать
последовательность остановок" Then
Command7.Enabled
= False
food
= True
q =
0
Else
Command7.Enabled
= True
food
= False
Combo4.Enabled
= False
Text4.Enabled
= False
Command3.Enabled
= False
Command4.Enabled
= False
Command5.Enabled
= False
Command6.Enabled
= False
End
If
End
Sub
Private
Sub Command11_Click()
Combo6.Enabled
= True
If
Text7.Text = "" Or Text6.Text = "" Or Text5.Text =
"" Then
MsgBox "Все поля
должны быть заполнены!!!"
Exit
Sub
End
If
arBusNumber(LinesCount
- 1, zzz) = LTrim(Str$(LinesCount - 1 + 1) + Combo5.List(zxz))
arDriveName(LinesCount
- 1, zzz) = Text6.Text
arConductorName(LinesCount
- 1, zzz) = Text5.Text
Combo6.AddItem
arBusNumber(LinesCount - 1, zzz)
Combo5.RemoveItem
Mi
zzz
= zzz + 1
End
Sub
Private
Sub Command12_Click()
If Len(Dir("c:\ Курсовая
моя\Свободные автобусы.txt")) = 0 Then
MsgBox "Файл
свободных автобусов не найден!!!" + vbCrLf + _
"Проверьте
его наличие : 'c:\ Курсовая моя\Свободные автобусы.txt'"
Exit
Sub
End
If
Combo3.Enabled
= True
Combo5.Enabled
= True
End
Sub
Private
Sub Command13_Click()
If
Text8.Text = "" Then MsgBox "Напишите название маршруту!!!":
Exit Sub
If
Len(Dir("c:\ Курсовая моя\Маршруты.txt")) = 0 Then
MsgBox "Файл
маршрутов не найден!!!" + vbCrLf + _
"Проверьте
его наличие : 'c:\ Курсовая моя\Маршруты.txt'"
Combo1.Enabled
= False
Label11.Visible
= False
Exit
Sub
End
If
Open
"c:\ Курсовая моя\Маршруты.txt" For Append As 1
Print
#1, Text8.Text
Close
1
Open
"c:\курсовая моя\" + Text8.Text + ".txt" For Output As 3
For
zzz = 0 To (Combo6.ListCount - 1)
Print
#3, "автобус,", arBusNumber(LinesCount - 1, zzz)
Print
#3, "водитель,", arDriveName(LinesCount - 1, zzz)
Print
#3, "кондуктор,", arConductorName(LinesCount - 1, zzz)
Next
zzz
For
i = 0 To (Combo7.ListCount - 1)
Print
#3, "остановка,", nama(LinesCount - 1, i), ",",
Combo7.List(i)
Next
i
Close
3
Open
"c:\ Курсовая моя\Свободные автобусы.txt" For Output As 6
For
i = 0 To (Combo5.ListCount - 1)
Print
#6, Combo5.List(i)
Next
i
Close
6
mnuNewLine_Click
End
Sub
Private
Sub Command14_Click()
Frame2.Visible
= False
End
Sub
Private
Sub Command15_Click()
Frame1.Visible
= False
End
Sub
Private
Sub Command16_Click()
If Text9.Text = ""
Then MsgBox "Напишите название остановки!!!" Else
_
nama(LinesCount
- 1, Combo7.ListIndex) = Text9.Text
End
Sub
Private
Sub Command17_Click()
Picture2.Cls
Combo6.Clear:
Combo6.Enabled = False
Combo5.Enabled
= False
Text6.Text
= "": Text6.Enabled = False
Text5.Text
= "": Text5.Enabled = False
Command11.Enabled
= False
Combo7.Enabled
= False: Combo7.Clear
Text9.Text
= "": Text9.Enabled = False
Command16.Enabled
= False: Command13.Enabled = False
End
Sub
Private
Sub Command2_Click()
If
Text1.Text = "" Or Text2.Text = "" Or Text3.Text =
"" Then
MsgBox "Все поля
должны быть заполнены!!!"
Exit
Sub
End
If
Select
Case DooM
Case
False: arDriveName(Mis, Misk) = Text2.Text
arConductorName(Mis,
Misk) = Text3.Text
Case
True: arBusNumber(Mis, Combo2.ListCount) = LTrim(Str$(Mis + 1) +
Combo3.List(Mi))
arDriveName(Mis,
Combo2.ListCount) = Text2.Text
arConductorName(Mis,
Combo2.ListCount) = Text3.Text
Combo2.AddItem
arBusNumber(Mis, Combo2.ListCount), Combo2.ListCount
Combo3.RemoveItem
Mi
End
Select
End
Sub
Private
Sub Command3_Click()
Doomy
= True
Picture1.Cls
Command4.Enabled
= True
Command5.Enabled
= True
Command6.Enabled
= True
End
Sub
Private
Sub Command4_Click()
If
Doomy = True Then
If
disk <> 999 Then
Image1(disk).Visible
= False
Label14(disk).Visible
= False
Combo4.List(disk)
= " - "
End
If
disk
= 999
End
If
End
Sub
Private
Sub Command5_Click()
Text4.Enabled
= True
If
Doomy = True Then Exit Sub
If
disk <> 999 Then
If
Do_Do = True Then
If Text4.Text = ""
Then
MsgBox "напишите
название остановки!!!"
Else
arStayName(Mis,
disk) = Text4.Text
For
i = 0 To 35
If
Label14(i).Caption = Combo4.List(disk) Then Label14(i).Caption = Text4.Text
Next
i
Me.Combo4.List(disk)
= Text4.Text
Do_Do
= False
End
If
End
If
End
If
End
Sub
Private
Sub Command6_Click()
If
Boom = True Then
If
disk <> 999 Then Image1(disk).DragMode = 1
Else
If
disk <> 999 Then Image1(disk).DragMode = 0
Boom
= True
End
If
End
Sub
Private
Sub Command7_Click()
Open
"c:\Курсовая моя\" + Combo1.List(Mis) + ".txt" For Output As
5
For
i = 0 To (Combo2.ListCount - 1)
If
Combo2.List(i) <> " - " Then
Print
#5, "автобус,", Combo2.List(i)
Print
#5, "водитель,", arDriveName(Mis, i)
Print
#5, "кондуктор,", arConductorName(Mis, i)
End
If
Next
i
If
Command10.Caption = "Сохранить все сделанные изменения" Then
For
i = 0 To (Combo4.ListCount - 1)
If
Combo4.List(i) <> " - " Then _
Print
#5, "остановка,", arStayName(Mis, i), ",",
arStayAbsciss(Mis, i), ",", arStayOrdinata(Mis, i)
Страницы: 1, 2, 3, 4, 5, 6 |