Versions Compared

Key

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

...

Expand
titleClick Edit on the component card, then MAKE A COPY AND EDIT to open the Translator editor

Refer to Customizing components Edit a Component to see how it's done if you have not done this before.

...

Expand
titleClick on MatchRules.lua in the Project Tree to see where we need to alter the code

Navigate to MatchRules.lua in the Project Tree. This is the function we need to alter:

Code Block
languagelua
function MatchFile(FileName)
   return true
end

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

...

Expand
titleMake a matching function which takes the prefix and sees if the filename starts with it

Create a third function, APPmatchPrefix, to determine if the filename matches the prefix. You can copy the code below:

Code Block
languagelua
function APPmatchPrefix(Prefix, FileName)
   local Part = FileName:sub(1, #Prefix)
   trace(Part, Prefix)
   return (Part == Prefix)
end

See the screenshot below and add a line to MatchFile to call and invoke AppmatchPrefix.

Concepts used:

...