Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleOpen the component in the translator with the customize Customize link

See Customizing components to see how done if you have not done this before.

Expand
titleWe Click on MatchRules.lua to see where we need to modify the matching algorithm - what do we start with?alter the code

The file reader component is deliberately simple and uses /wiki/spaces/IXB/pages/3181903910 to make it more obvious how to modify the code to meet new needs. So this is what we are starting off with. We need this function to return true when the matching criteria are met.

https://bitbucket.org/interfaceware/fromfile/src/main/MatchRules.lua

Code Block
languagelua
function MatchFile(FileName)
   return true
end

...

Expand
titleNow change the matching code so we go through all the of the list

We write the new MatchFile function based on the functions we have written alreadyLet’s modify the code to go through the entire list of prefixes:

Code Block
languagelua
for i = 1, #IdList do
   if APPmatchPrefix(IdList[i], JustFileName) then 
      return true
   end
end
return false -- we didn't match anything

And this is what you should see:

Concepts used:

...