Versions Compared

Key

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

...

Expand
titleExamine the file contents in the translator - each segment ends in \r but the message ends with \n characters

We can easily see by looking at the contents of the file using the Escaped Text escaped mode of:

Image Removed

The string viewing window

require "FIL.FILreadWrite" function main(Data) local F = component.fields().InputFile trace(F) local Content = FILread(F) local

The List contains an Lua table as list

Expand
titleThen we split the contents on the \n with local List = Content:split("\n")

See String:split(). So now our code looks like this:

Code Block
Code Block
local List = Content:split("\n")
   trace(#List)    end

In the editor it looks like:

Image Removed

By double clicking of the list coming back we can we the list of messages:

Image Removed
Expand
titleWith a for loop we can push these messages into the queue:

See Lua tables table as listslist

Code Block
for i=1, #List do
   queue.push{data=List[i]}
end

And now we have a working test component!

...