I have a table with one of its fields called EmpName. This field has the employee last name, first name and middle initial. The last name and first name are separated by a comma. I would like to read each record in my table and replace the comma in the EmpName field with a space. Here is the script I composed to do this job however, it is not working. I would appreciate any suggestions on how to correct this script.
---------------------------------------------------------------------------------------------------
method run(var eventInfo Event)
var
tc TCursor
ar Array[3] String ;AnyType
s, news String
endvar
tc.open("Empaddress2.DB"
tc.edit()
ar.setSize(3)
scan
tc for tc."FIELD005" <> " ":
s = tc."FIELD005"
s.breakApart(ar, "," ; breaks on commas
news = ar[1] + ar[2]
tc."FIELD005" = news
endscan
tc.endedit()
tc.close()
endMethod
---------------------------------------------------------------------------------------------------
Thanks,
Wilbert Brown
---------------------------------------------------------------------------------------------------
method run(var eventInfo Event)
var
tc TCursor
ar Array[3] String ;AnyType
s, news String
endvar
tc.open("Empaddress2.DB"
tc.edit()
ar.setSize(3)
scan
tc for tc."FIELD005" <> " ":
s = tc."FIELD005"
s.breakApart(ar, "," ; breaks on commas
news = ar[1] + ar[2]
tc."FIELD005" = news
endscan
tc.endedit()
tc.close()
endMethod
---------------------------------------------------------------------------------------------------
Thanks,
Wilbert Brown