Frank Wunderlich:
Hi Roman,
the script works perfect except files that be commented out...

is there a possibility to exclude values that have // before '..' or (* and *) or { and } around '..'?


e.g. following files must not be opened:

...//...'Test.pas'...
...{...'Test.pas'...}...
...(*...'Test.pas'...*)...

Hi,

I think the easiest solution is to replace out such items. I've added three string.gsub lines in the script and it seems to work fine:

function openPasFromDpr2()
  local dfm  = props['FilePath']
  local path = props['FileDir']  --without trailing /\
  local file = editor:textrange(0, editor.Length)
  for uses in string.gfind(file, "uses.-;") do
    uses = string.gsub(uses,"//.-\n","")
    uses = string.gsub(uses,"{.-}","")
    uses = string.gsub(uses,"%(%*.-%*%)","")
    for c in string.gfind(uses, "\'([^\']*)\'") do
      scite.Open(path .. '\\' .. c)
    end
  end
  scite.Open(dfm)
end

-- regards Roman

_______________________________________________
Scite-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scite-interest

Reply via email to