Программирование в Бейсике

Курсовой проект - Компьютеры, программирование

Другие курсовые по предмету Компьютеры, программирование

is, 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)

"-"Then">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)

"-"Then_">If Combo4.List(i) <> " - " Then _

Print #5, "остановка,", arStayName(Mis, i), ",", arStayAbsciss(Mis, i), ",", arStayOrdinata(Mis, i)

Next i

Else

For i = 0 To (Combo4.ListCount - 1)

"-"Then_">If Combo4.List(i) <> " - " Then _

Print #5, "остановка,", arName(Mis, i), ",", arAbsciss(Mis, i), ",", arOrdinata(Mis, i)

Next i

End If

Close 5

Open "c:\ Курсовая моя\Свободные автобусы.txt" For Output As 6

For i = 0 To (Combo3.ListCount - 1)

Print #6, Combo3.List(i)

Next i

Close 6

End Sub

Private Sub Command8_Click()

If DooM = True Then MsgBox "Нечего удалять!!!"

If DooM = False Then

Combo2.List(Misk) = " - "

If Len(Dir("c:\ Курсовая моя\Свободные автобусы.txt")) = 0 Then

MsgBox "Файл маршрутов не найден!!!" + vbCrLf + _

"Проверьте его наличие : c:\ Курсовая моя\Свободные автобусы.txt"

Exit Sub

End If

Open "c:\ Курсовая моя\Свободные автобусы.txt" For Append As 7

Print #7, arBusNumber(Mis, Misk)

Close 7

End If

End Sub

Private Sub Command9_Click()

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 Output As 4

For i = 0 To (Combo1.ListCount - 1)

MisThenPrint#4,Combo1.List(i)">If i <> Mis Then Print #4, Combo1.List(i)

Next i

Close 4

Open "c:\ \" + Combo1.List(Mis) + ".txt" For Output As 4

Close 4

End Sub

Private Sub Form_Load()

aa = 0

q = 999

For i = 1 To 35

Load Image1(i)

Load Label14(i)

Me.Image1(i).Visible = False

Me.Label14(i).Visible = False

Next i

disk = 999

End Sub

Private Sub Image1_Click(Index As Integer)

w = Image1(0).Width / 2

If q = 0 Then

Picture1.PSet (Image1(Index).Left, Image1(Index).Top)

Combo4.Clear

End If

If food = True Then

Command10.Caption = ""

arName(Mis, q) = arStayName(Mis, Index)

arAbsciss(miss, q) = arStayAbsciss(Mis, Index)

arOrdinata(miss, q) = arStayOrdinata(Mis, Index)

Combo4.AddItem arName(Mis, q)

Picture1.Line -(arStayAbsciss(Mis, Index), arStayOrdinata(Mis, Index))

q = q + 1

Else

disk = Index

Combo4.ListIndex = disk

End If

End Sub

Private Sub mnuEditLine_Click()

Combo1.Clear

Me.Frame1.Visible = True

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 Input As 1

LinesCount = 0

Do While Not EOF(1)

Input #1, arLinesName(LinesCount)

Combo1.AddItem arLinesName(LinesCount)

LinesCount = LinesCount + 1

Loop

Close 1

End Sub

Private Sub mnuFree_Click()

If Len(Dir("c:\ Курсовая моя\Свободные автобусы.txt")) = 0 Then

MsgBox " Файл маршрутов не найден!!!" + vbCrLf + _

" Проверьте его наличие: c:\ Курсовая моя\Свободные автобусы.txt"

Exit Sub

End If

Retval = Shell("NotePad.exe c:\ Курсовая моя\Свободные автобусы.txt", 1)

End Sub

Private Sub mnuLines_Click()

Form2.Show

End Sub

Public Static Sub Files()

arBusCount(Mis) = 0

arStayCount(Mis) = 0

Open "c:\ \" + Combo1.List(Mis) + ".txt" For Input As 2

Do While Not EOF(2)

Input #2, a$

Select Case a$

Case "автобус": Input #2, arBusNumber(Mis, arBusCount(Mis))

Case "водитель": Input #2, arDriveName(Mis, arBusCount(Mis))

Case "кондуктор": Input #2, arConductorName(Mis, arBusCount(Mis))

arBusCount(Mis) = arBusCount(Mis) + 1

Case "остановка": Input #2, arStayName(Mis, arStayCount(Mis))

Input #2, arStayAbsciss(Mis, arStayCount(Mis))

Input #2, arStayOrdinata(Mis, arStayCount(Mis))

arStayCount(Mis) = arStayCount(Mis) + 1

End Select

Loop

Close 2

End Sub

Private Sub Image1_DragOver(Index As Integer, Source As Control, X As Single, Y As Single, State As Integer)

If e = 0 Then

mx = X

my = Y

e = 1

End If

End Sub

Private Sub mnuNewLine_Click()

zzz = 0

Frame1.Visible = False

Frame2.Visible = True

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 Input As 1

LinesCount = 0

Do While Not EOF(1)

Input #1, arLinesName(LinesCount)

Combo1.AddItem arLinesName(LinesCount)

LinesCount = LinesCount + 1

Loop

Close 1

i = 0

Open "c:\ Курсовая моя\Свободные автобусы.txt" For Input As 3

Do While Not EOF(3)

Input #3, arFreeBuses(i)

Combo5.AddItem arFreeBuses(i)

i = i + 1

Loop

Close 3

End Sub

Private Sub Picture1_DragDrop(Source As Control, X As Single, Y As Single)

Source.Move X - mx, Y - my: Label14(disk).Move X - mx + w * 2, Y - my