Hello,

I have a multiline text that collects logs and other interesting tags for
debugging purposes. Stats help me identify the most interesting tags, and I
want to find them in the detailed logs.
To find a string in the control, I must get its VALUE attribute (which
interns its contents as a big Lua string). Then I can search whatever I
want in that string.
Is there a better way to avoid interning such a big string?

Then, I want to highlight the lines where I found what I searched for.
I am trying the following:

                local what, where = inText.value, resultText.value
                local lineIdx = 1
                for line, sep in string.split( where, "\n") do
                    if string.find( line, what, 1, true) then
                        resultText.addformattag = iup.user{ bgcolor = "255
0 0", selection = lineIdx .. ",1:" .. lineIdx .. ":999"}
                        break
                    end
                    lineIdx = lineIdx + 1
                end

However, this doesn't change the formatting of the line I found. I have
already successfully applied formatting to multiline text, but I did this
by setting the formatting tag, then appending some text that would get
formatted, as follows:

            resultText.addformattag = iup.user{ bgcolor ="255 255 128"}
            resultText.append = "========================= " .. os.date(
"%d/%m/%Y %X") .. " ========================="

Is it possible to format parts of the text already present in the control?


Regards,

-- 
Benoit.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to