I’m sorry, but I think it’s a very simple question (and I’m a bit too lazy to search all around…)
I have a string delimited with / Ex: 5050/55050/5050/7707/5505/50606/… very very long. I want to create a table with one field and replace the field with the values, like that;
5050
55050
5050
7707
5505
50606
I have this very ugly routine to do this, and it’s very slow…
Thanks in advance
Nro
I have a string delimited with / Ex: 5050/55050/5050/7707/5505/50606/… very very long. I want to create a table with one field and replace the field with the values, like that;
5050
55050
5050
7707
5505
50606
I have this very ugly routine to do this, and it’s very slow…
Code:
USE pipo.dbf
lcRet = "5050/55050/5050/7707/5505/50606/"
lcPro_Code = ""
DO WHILE .T.
IF AT("/",lcRet,1) >= 1 THEN
lcPro_Code = LEFT(lcRet,AT("/",lcRet,1)-1)
APPEND BLANK
REPLACE Pro_Code WITH lcPro_Code
lcRet = SUBSTR(lcRet, AT("/",lcRet,1)+1)
ELSE
EXIT
ENDIF
IF LEN(lcRet) <= 1 THEN
EXIT
ENDIF
ENDDO
Thanks in advance
Nro