Having issues with nested lists

I'm trying to understand how list works, just not getting the setup.

To summarize, I have a text file with words in it separated by suffix +++++, please see below.

What
time
is
+++++
what
date
is
+++++ (And so on)

The aim of the code is to save the words up to (++++) in another list function which I then goes through those words saved and match's them with a string typed in from the user.
For instance how many "Whats" words are in the list array.

When I run the program I get
is
what
is

for the 1st 3 values in the array.

Seems to have missed the 1st two words in the list.

Another question, when using a (for each item) loop is the index to the list array automatically incremented. Is it possible to use the same list array in different routines nested.

If I have a main loop accessing a list array and call another loop that requires testing of the same list array can i use another (for each item) loop and still return to the main loop and continue from the last location in the list array.

Thanks

Thomas

Thomas
QuestionAir.aia (5.0 KB)

i dont understand why do you want loop? by this way you can skip the +++++. If you want positions of the ++++ then in the else block you can add the counter value

Sorry if i misunderstand you

Im trying to match the words within the ++++ strings with a user typed sentence.
for example the user might type in the textbox "What is the current time", in my text file I want to see how many times each word in the sentance appears within the text file +++++ prefix and suffix.

If the user writes "what is the time"

The text file might have
+++++
what
time
is
it
+++++
then "time" appears once, "what" appears once, "is" apears once and "it" appears zero

Hope that helps

Found the problem, I dident have an index pointer for the second list

Thanks for your help

Thomas

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.