# dfasearch getting started

Please compile the application with:
java -jar ant16.jar dist_bin
Please run the application with:
java -Xmx1000m -jar app_dfasearch-bin.jar
Please open the resulting CSV file in Excel. Mark the acceptance table and name its range as "a". Mark the transition table and name its rnage as "t". Please press Alt-F11, choose the menu option to add a module and insert the following definition:
Public Function dfasearch(x As String)
Static dummy, a, t
If IsEmpty(dummy) Then
dummy = 1
a = Application.Range("a").Cells
t = Application.Range("t").Cells
End If
s = 0
y = ""
x = strconv(x,vbLowerCase)
l = Len(x)
dfasearch = ""
For i = 1 To l
code = Asc(Mid(x, i, 1))
If (code > 159) Then
code = 0
End If
s = t(s + 2, code + 2)
r = a(s + 2, 2)
If (r > y) Then
y = r
End If
Next i
dfasearch = Mid(y, 3, 99)
End Function
You can now type into a cell:
=dfasearch(A5)
which will perform the DFA search on the contents of that cell.