set a to the textstyle of char qcar of field rcast
set stile to a
if a="bold,italic" or (a="italic,bold") then
set a to "bold"
end if
if a="underline,italic" or (a="italic,underline") then
set a to "underline"
end if
if a = "bold" or a = "underline" then
CURSOR 4
if the last char of word nparola of field rcast = "," and the last char of word nparola-1 of field rcast = "," then
mostrat stile, pulisci (word nparola of field rcast)
exit
end if
if the last char of word nparola of field rcast = "," and the textstyle of word nparola-1 of field rcast = "plain" then
mostrat stile, pulisci (word nparola of field rcast)
exit
end if
if the last char of word nparola-1 of field rcast = "," and the textstyle of word nparola+1 of field rcast = "plain" then
mostrat stile, pulisci (word nparola of field rcast)
exit
end if
if nparola > 1 then
set stile to the textstyle of char qcar of field rcast
set temp to nparola - 1
set a to the textstyle of word temp of field rcast
set inizio to temp + 1
repeat while a = stile and (inizio >0 )
set temp to temp - 1
set a to the textstyle of word temp of field rcast
set inizio to temp+1
end repeat
end if
set temp to nparola+1
set a to the textstyle of word temp of field rcast
set fine to temp -1
repeat while a = stile and fine < the number of words in field rcast
set temp to temp + 1
set a to the textstyle of word temp of field rcast
set fine to temp-1
end repeat
if voidp (inizio) then set inizio to nparola
if voidp (fine) then set fine to nparola
if the textstyle of char (the number of chars in word inizio -1 of field rcast)-1 of word inizio-1 of field rcast = "bold" or the textstyle of char (the number of chars in word inizio -1 of field rcast)-1 of word inizio-1 of field rcast= "underline" then