I don't want to worry about the text boxes and stuff, just seeing your input and parsing through the string comparing it to the file to make a graphical ai program. Here is the current VB source code(i know it isn't really great)
'form1 *main
Public Wrd As String
Public Wrdlngth As Integer
Public Wrdcntr As Integer
Public Strpiece As String
Public Comppiece As String
Public Filter As String
Public Specwrd As String
Public Prtofwrd As Integer
Public Whlwrd As String
Public Cont As Integer
Public Opnfl As Integer
Private Sub Command1_Click()
Wrd = Text1.Text
Wrdlngth = Len(Wrd)
Wrd = LCase$(Wrd)
Call FindWord
For Wrdcntr = 1 To Wrdlngth
Strpiece = Mid(Wrd, Wrdcntr, 1)
If Strpiece = "?" Then GoTo obel
Next Wrdcntr
Open "c:\dict.dict" For Input As #1
Do While Not EOF(1)
Input #1, Filter
If Filter = "Base Word" Then
Input #1, Filter
If Filter = Wrd Then
Input #1, Filter
Text2.Text = Text2.Text & " " & Filter
End If
End If
Loop
GoTo BB
obel:
Cont = 0
'prtofwrd/whlwrd/strpiece
Wrdlngth = Len(Wrd)
Wrd = LCase$(Wrd)
Comppiece = ""
Prtofwrd = 1
Nxt:
If Opnfl = 1 Then
Close #1
Opnfl = 0
End If
Open "c:\dict.dict" For Input As #1
Opnfl = 1
Do Until Filter = "[questions]"
Input #1, Filter
Loop
Whlwrd = ""
Comppiece = ""
Do Until Comppiece = " "
Whlwrd = Whlwrd & Comppiece
Comppiece = Mid(Wrd, Prtofwrd, 1)
Prtofwrd = Prtofwrd + 1
If Comppiece = "?" Then
Cont = 1
GoTo EXT
End If
Loop
Do While Not EOF(1)
EXT:
Input #1, Filter
If Filter = "Base Q" Then
Input #1, Filter
If Filter = Whlwrd Then
Prtofwrd = 1
NdLp:
Input #1, Filter
Do Until Filter = ","
Whlwrd = ""
Comppiece = ""
Do Until Comppiece = " "
Whlwrd = Whlwrd & Comppiece
Comppiece = Mid(Wrd, Prtofwrd, 1)
Prtofwrd = Prtofwrd + 1
If Comppiece = "?" Then
Cont = 1
GoTo NdLp
End If
Loop
If Whlwrd = Filter Then
Input #1, Filter
If Filter = "," Then
Input #1, Filter
Text2.Text = Text2.Text & " " & Filter
End If
GoTo BB
End If
Loop
End If
End If
Loop
If Cont = 0 Then GoTo Nxt
If Cont = 1 Then GoTo BB
BB:
Close #1
End Sub
Public Sub FindWord()
'Hunt Special Words
Specwrd = "time"
Wrdlngth = Len(Wrd)
Wrdcntr = 1
Prtofwrd = 1
Comppiece = Mid(Specwrd, 1, 1)
For Wrdcntr = 1 To Wrdlngth
Strpiece = Mid(Wrd, Wrdcntr, 1)
If Strpiece = Comppiece Then
Prtofwrd = Prtofwrd + 1
Comppiece = Mid(Specwrd, Prtofwrd, 1)
If Comppiece = "e" Then
Filter = Time
Text2.Text = Text2.Text & " The current time is " & Filter
End If
End If
Next Wrdcntr
Specwrd = "how are you"
Wrdlngth = Len(Wrd)
Wrdcntr = 1
Prtofwrd = 1
Comppiece = Mid(Specwrd, 1, 1)
For Wrdcntr = 1 To Wrdlngth
Strpiece = Mid(Wrd, Wrdcntr, 1)
If Strpiece = Comppiece Then
Prtofwrd = Prtofwrd + 1
Comppiece = Mid(Specwrd, Prtofwrd, 1)
If Comppiece = "u" Then
Filter = Time
Text2.Text = Text2.Text & "Right now I'm not programmed to impersonate emotion but i seem to be operating fine."
End If
End If
Next Wrdcntr
Specwrd = "!edit"
Wrdlngth = Len(Wrd)
Wrdcntr = 1
Prtofwrd = 1
Comppiece = Mid(Specwrd, 1, 1)
For Wrdcntr = 1 To Wrdlngth
Strpiece = Mid(Wrd, Wrdcntr, 1)
If Strpiece = Comppiece Then
Prtofwrd = Prtofwrd + 1
Comppiece = Mid(Specwrd, Prtofwrd, 1)
If Comppiece = "t" Then
Form2.Show
End If
End If
Next Wrdcntr
End Sub
Private Sub Form_Load()
Form2.Hide
End Sub
All i want to really do is go through the string and the files the same way using the same format
Public Ad As String
Public AddWhat As Integer
Private Sub Command1_Click()
End Sub
Private Sub Command2_Click()
Command2.Visible = False
If Combo1.Text = "Word" Then
Combo1.Visible = False
AddWhat = 1
Text2.Visible = True
Label1.Visible = True
End If
End Sub
Private Sub Form_Load()
Text1.Text = ""
Open "c:\dict.dict" For Input As #1
Do While Not EOF(1)
Input #1, Ad
Text1.Text = Text1.Text & ":" & Ad
Loop
Close #1
End Sub
Private Sub Timer1_Timer()
Text1.Text = ""
Open "c:\dict.dict" For Input As #1
Do While Not EOF(1)
Input #1, Ad
Text1.Text = Text1.Text & ":" & Ad
Loop
Close #1
End Sub
this is the second forms code but for this i can just make it open the dictionary file.
Thx for your help.