
(je suis perdu - l'interfaçage avec OCLua pour pouvoir tester en live) n'a pas été encore fait, si ?)
if isColor then
e=1
a=1
t=1
while t<=table.getn(cs) do
e,a=0,1
testcs=cs[t]
while not(a==nil) do
a,b=string.find(chainy,testcs[1],e)
prechar=nil
postchar=nil
if testcs[3] then -- si le mot doit etre isole...
if a~=nil and a~=1 then --si a existe et a~=debut de ligne
prechar=chainy:sub(a-1,a-1)
if prechar==" " then
prechar=true
else
prechar=false
end
elseif a~=nil and a==1 then -- si a existe mais a=debut de ligne
prechar=true
end
if b~=nil and b~=#buffer[i] then --si b existe et b~= fin de ligne aussi
postchar=chainy:sub(b+1,b+1)
if postchar==" " then
postchar=true
else
postchar=false
end
elseif b~=nil and b==#buffer[i] then -- si b existe mais b==fin de ligne
postchar=true
end
end
-- a existe, et ( pas besoin d'isoler OU (prechar ET postchar sont conformes à l'isolation)
if a~=nil and ( not(testcs[3]) or (prechar and postchar)) then
-- on colorie!
m=gc:getStringWidth(string.sub(chainy,0,a-1))
setColor(testcs[2])
gc:drawString(string.sub(chainy,a,b),m+z,j*15) --
setColor("black")
e=b -- on test a partir de la fin du mot
end
e=e+1
end
t=t+1
end
end
Donald Knuth wrote:Beware of bugs in the above code; I have only proved it correct, not tried it.
AlexRider38 wrote:lien mort
Donald Knuth wrote:Beware of bugs in the above code; I have only proved it correct, not tried it.
Users browsing this forum: ClaudeBot [spider] and 2 guests