Extract items
Yves COPPE
yvescoppe at skynet.be
Fri Mar 3 03:06:23 EST 2006
Le 3 mars 06 à 09:00, Joseba Aguayo a écrit :
> Hello:
>
> ¿Exists in Revolution an order similar to the Extract Rinaldi XCMD?
> ¿Is possible to extract one or two items (item 3 to 4) of a list
> separate with tabs.
>
> Thanks.
>
> Un saludo
I've a function which do the same in transcript :
Filedname = the name of the fld or the variable with the data
pItemNumber = the item(s) to be extracted
delim = the item delimiter
function extractItem pFieldName, pItemNumber,delim
local tempLine, tempItem,vListofItems,vListToReturn
put itemDelimiter into oldDelim
replace comma with delim in pItemNumber
set itemDelimiter to delim
repeat for each line tempLine in pFieldName
put empty into vListofItems
repeat for each item tempItem in pItemNumber
put item tempItem of tempLine &delim after vListofItems
end repeat
delete last char of vListofItems
put vListofItems& return after vListToReturn
end repeat
set itemDelimiter to oldDelim
if the number of lines of vListToReturn > 1 then
delete last char of vListToReturn
end if
return vListToReturn
end extractItem
Greetings.
Yves COPPE
yvescoppe at skynet.be
More information about the use-livecode
mailing list