hi i have a 2 texte file:
1-the first i want to put it in the list view i mean each line in text file is an item in the list view
2- when user click on the item list view an other screen opened
3-here label shown with an explination of the item selected by user this explination is in the seconde texte file
this an image for content of txt file 1
The second file can be used to populate a TinyDB NameSpace, with tags made from the lines that begin with numbers followed by a period (.), and values consisting of that line until the next tag line from the file.
You would need a loop over the file text.
The tag list would be your Elements list.
After selection, load the TinyDB value from that tag.
To detect if a line is a tag, split it at first '.', and test if item 1 is a number.
The first text split you need is at \n to get a list of the lines into a global variable (call it Lines).
You will need two variables:
CurrentTag, to hold the tag you will use for TinyDB once you have filled a Paragraph with text
You also need a variable called Paragraph, initially empty text, to hold the current paragraph you are building.
Pseudo-code (make it in blocks)
(in the event that catches the File text)
for each line in global Lines
init local SplitResult to (split line at ':')
if is a number (select item 1 from SplitResult) then
save to TinyDB (CurrentTag, Paragraph)
set CurrentTag to line
set Paragraph to line
else
set Paragraph to text JOIN(Paragraph, '\\n', line
end for each
save to TinyDB (CurrentTag, Paragraph)