R
robertjhuff
Hi,
Below is a snippet of code that works compiled in a MDE application:
============= SNIP BEGIN =====================
Public Function LevDist(ByVal pStr1, ByVal pStr2) As Integer
'******************** Levenshtein Distance
**************************************************
'* Levenshtein Distance algorithm is named after the Russian scientist
'* Vladimir Levenshtein, who devised the algorithm in 1965
'*
'* Levenshtein edit distance is the number of insertions, deletions, or
'* replacements of single characters that are required to convert one
'* string to the other.
'*
'* Character transposition is detected in Step 6A.
'* Transposition is given a cost of 1.
'*
'* Normally Levenshtein edit distance is symmetric.
'* That is, LevDist(pStr1 , pStr2) is the same as LevDist(pStr2 ,
pStr1).
'*
'********************************************************************************************
Dim n As Integer, m As Integer, matrix() As Integer
Dim i As Integer, j As Integer, cost As Integer, t_j, s_i
Dim above As Integer, left As Integer, diag As Integer, cell As
Integer
Dim trans As Integer
' Step 1
n = UBound(pStr1)
m = UBound(pStr2)
============= SNIP ENDS=====================
When I copy the code into a Access 2003 Module and attempt to execute
it fails with a mis-match type error upon the statement 'n =
UBound(pStr1)' which seems correct as a string is being passed.
And yet the code works in the MDE!
What am I missing?
Thanks,
Bob
Below is a snippet of code that works compiled in a MDE application:
============= SNIP BEGIN =====================
Public Function LevDist(ByVal pStr1, ByVal pStr2) As Integer
'******************** Levenshtein Distance
**************************************************
'* Levenshtein Distance algorithm is named after the Russian scientist
'* Vladimir Levenshtein, who devised the algorithm in 1965
'*
'* Levenshtein edit distance is the number of insertions, deletions, or
'* replacements of single characters that are required to convert one
'* string to the other.
'*
'* Character transposition is detected in Step 6A.
'* Transposition is given a cost of 1.
'*
'* Normally Levenshtein edit distance is symmetric.
'* That is, LevDist(pStr1 , pStr2) is the same as LevDist(pStr2 ,
pStr1).
'*
'********************************************************************************************
Dim n As Integer, m As Integer, matrix() As Integer
Dim i As Integer, j As Integer, cost As Integer, t_j, s_i
Dim above As Integer, left As Integer, diag As Integer, cell As
Integer
Dim trans As Integer
' Step 1
n = UBound(pStr1)
m = UBound(pStr2)
============= SNIP ENDS=====================
When I copy the code into a Access 2003 Module and attempt to execute
it fails with a mis-match type error upon the statement 'n =
UBound(pStr1)' which seems correct as a string is being passed.
And yet the code works in the MDE!
What am I missing?
Thanks,
Bob