Versions Compared

Key

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

...

Expand
titleWe need to modify the matching algorithm - what do we start with?

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
function MatchFile(FileName)
   return true
end
Expand
titleLet's extract the filename so we can look at it:

Change the matching to add in two lines:

Code Block
function MatchFile(FileName)
   local JustFileName = FILfilename(FileName)
   trace(JustFileName);
   return true;
end

Expand
titleStart the new MatchFile logic with getting the list of prefixes and removing white space

We’ll apply /wiki/spaces/IXB/pages/3181903910 and write this as a function:

Code Block
function APPidList()
   local IdList = component.fields()["ClientList"]
   IdList = IdList:split(",")
   for i = 1, #IdList do
      IdList[i] = IdList[i]:trimWS()
   end
   return IdList
end

function MatchFile(FileName)
   local IdList = APPidList();
   return true
end

These are the concepts we have used:

...