I am trying to search a string for an errant space at the end of a name, and then replace the record with the name minus the space at the end. This will help in some record comparisons later down the line.
I'm pretty sure that I am missing only something small, Thanks in advance.
I'm pretty sure that I am missing only something small, Thanks in advance.
Code:
srcTC.open(sourcefile)
srcTC.edit()
while not srcTC.eot()
Fname = srcTC."FIRSTNAME"
Fnsize = (Fname.size()) ;// reports the amount of characters in the Firstname field.
if subStr(Fname,1,Fnsize - 1 ) = " " then
srcTC."FIRSTNAME" = subStr(Fname,1,Fnsize - 1)
else
endIf
if srcTC."ADDRCORRECT" = "" then
srcTC."ADDRCORRECT" = "Y"
else
endIf
if srcTC."CANCELCODE" = "DC" then
srcTC."CANCELCODE" = "D"
else
endIf
status = " Fixing source file"
srcTC.nextrecord()
endWhile
srcTC.close()