keepingbusy
Programmer
Hi
Can anyone suggest a quicker way to produce the below?
The code initially looks for a letter contained in a string within a field, removes that letter then replaces three other columns with infomation.
Your thoughts or suggestions would be appreciated as this current process takes about 35 minutes to search through 270,000 records.
Code:
Use MyTable
SCAN
var1=UPCOLD
DO CASE
CASE "A" $ UPCOLD
REPLACE UPCOLD WITH STRTRAN(var1,"A",'')
CASE "B" $ UPCOLD
REPLACE UPCOLD WITH STRTRAN(var1,"B",'')
CASE "S" $ UPCOLD
REPLACE UPCOLD WITH STRTRAN(var1,"S",'')
CASE "L" $ UPCOLD
REPLACE UPCOLD WITH STRTRAN(var1,"L",'')
ENDCASE
REPLACE COLUMN5 WITH ALLTRIM(UPCOLD)+'.jpg'
REPLACE COLUMN6 WITH ALLTRIM(UPCOLD)+'.jpg'
REPLACE COLUMN7 WITH ALLTRIM(UPCOLD)
ENDSCAN