my client wishes to screen names and addresses
eg. ",Lane" " ", Lane" "Lane" -> Ln
"Rt" "Rt." " Rt" " Rt." ",Rt" -> RR
while there are many more they wish to screen for, this at least gives you an idea of the problem, part of which is where the characters are in the field and what comes before and after, etc.
the order of the checks would be critical, too
like (if " Rt") before (if "rt")
below is a test script I developed, but would appreciate any better ideas anyone has. (I saw someone write about a 50 line script to do something - and they were VERY proud of the results - and then Ira posted a 1 liner that did the same thing - I bet they were sick!!)
loop:
test=ui_get_text("","")
if test=""
end
end if
if ",jr." $ lower(test)
temp=",jr."
end if
if ", jr." $ lower(test)
temp=", jr."
end if
n=at(temp,lower(test))
ui_msg_box("","before " + str(n,2,0) + " " + test)
test=substr(test,1,n-1)
ui_msg_box("","after " + test)
goto loop
end
since each value you were checking for would have many different possibilites, I could also say
tbl=table.open("namescheck")
'the order of the index would
'dictate which got evaluated first
tbl.index_primary_put("checkorder")
tbl.fetch_first()
for i=1 to tbl.records_get()
temp=tbl.namecheck
and then say if tbl.name $ a_field_value (or t.first_name, etc.)
any ideas appreciated
eg. ",Lane" " ", Lane" "Lane" -> Ln
"Rt" "Rt." " Rt" " Rt." ",Rt" -> RR
while there are many more they wish to screen for, this at least gives you an idea of the problem, part of which is where the characters are in the field and what comes before and after, etc.
the order of the checks would be critical, too
like (if " Rt") before (if "rt")
below is a test script I developed, but would appreciate any better ideas anyone has. (I saw someone write about a 50 line script to do something - and they were VERY proud of the results - and then Ira posted a 1 liner that did the same thing - I bet they were sick!!)
loop:
test=ui_get_text("","")
if test=""
end
end if
if ",jr." $ lower(test)
temp=",jr."
end if
if ", jr." $ lower(test)
temp=", jr."
end if
n=at(temp,lower(test))
ui_msg_box("","before " + str(n,2,0) + " " + test)
test=substr(test,1,n-1)
ui_msg_box("","after " + test)
goto loop
end
since each value you were checking for would have many different possibilites, I could also say
tbl=table.open("namescheck")
'the order of the index would
'dictate which got evaluated first
tbl.index_primary_put("checkorder")
tbl.fetch_first()
for i=1 to tbl.records_get()
temp=tbl.namecheck
and then say if tbl.name $ a_field_value (or t.first_name, etc.)
any ideas appreciated