home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Invenzioni E Inventori 1: Lavoro E Vita Quotidiana
/
invenzioni-inventori-1.iso
/
mac
/
Invenzio
/
index.dir
/
00129_Script_129
< prev
next >
Wrap
Text File
|
1997-10-15
|
1KB
|
43 lines
on pulisci_alberi
global x,y,xmax,ni,str,str1
set xmax to the number of lines in field "albero" of castlib "internal"
-- set xmax to 1
set alberi to the text of field "alberi" of castlib "indart"
set the text of field "albero nuovo" of castlib "internal" to ""
repeat with x=1 to xmax
set str to line x of field "albero" of castlib "internal"
set ni to the number of items in str
repeat with z =1 to ni
set num to value(item z of str)
if num >0 then
set ni_new to num
exit repeat
end if
end repeat
set str1 to ""
set num to 0
repeat with y=1 to ni_new
set alb to item y of str
set trovato to offset (alb,alberi)
if trovato>0 then
set str1 to str1 & alb &","
set num to num +1
end if
end repeat
if num>0 then
set str1 to str1 & string(num) & ","
repeat with w = ni_new+2 to ni-1
set str1 to str1 & item w of str & ","
end repeat
set str1 to str1 & item ni of str & RETURN
put str1 after field "albero nuovo" of castlib "internal"
end if
end repeat
end