Mrphone Member Jun 1, 2020 #1 Hello everyone I have a text (.txt) file that I will convert to a list using the following command ? CODE: Dim data as list data.Initialize data = File.ReadList(File.DirAssets,"Number.txt") How can I search in this list ??! And put the result back on the list
Hello everyone I have a text (.txt) file that I will convert to a list using the following command ? CODE: Dim data as list data.Initialize data = File.ReadList(File.DirAssets,"Number.txt") How can I search in this list ??! And put the result back on the list
Biswajit Active Member Licensed User Longtime User Jun 1, 2020 #2 Use IndexOf for searching and Set to put some value to a known index. Upvote 0
Mrphone Member Jun 1, 2020 #3 Biswajit said: Use IndexOf for searching and Set to put some value to a known index. Click to expand... Thank you for your answer ? Please give a simple example ? I am a novice ? Upvote 0
Biswajit said: Use IndexOf for searching and Set to put some value to a known index. Click to expand... Thank you for your answer ? Please give a simple example ? I am a novice ?
Biswajit Active Member Licensed User Longtime User Jun 1, 2020 #4 B4X: Dim l as list l.Add("abc") l.Add("efg") log(l.IndexOf("abc")) 'output: 0 log(l.Get(1)) 'output: efg l.Set(1,"xyz") log(l.Get(1)) 'output: xyz Upvote 0
B4X: Dim l as list l.Add("abc") l.Add("efg") log(l.IndexOf("abc")) 'output: 0 log(l.Get(1)) 'output: efg l.Set(1,"xyz") log(l.Get(1)) 'output: xyz