tchart Well-Known Member Licensed User Longtime User Apr 3, 2024 #1 As per title, is the order of File.ReadList guaranteed to be the same as the files lines? Ive got a scenario where I need to check the first few lines of a file to ensure its the correct type of file.
As per title, is the order of File.ReadList guaranteed to be the same as the files lines? Ive got a scenario where I need to check the first few lines of a file to ensure its the correct type of file.
William Lancee Well-Known Member Licensed User Longtime User Apr 3, 2024 #2 Yes. The order is exactly the same. Upvote 1 Solution
tchart Well-Known Member Licensed User Longtime User Apr 3, 2024 #3 Awesome, Ive also checked this, and it seems reliable. B4X: Dim l As List l.Initialize For c = 0 To 1000000 l.Add(c) Next File.WriteList(File.DirApp,"out.txt",l) Dim l2 As List = File.ReadList(File.DirApp,"out.txt") Log(l2.Get(0)) Log(l2.Get(l2.Size-1)) Upvote 0
Awesome, Ive also checked this, and it seems reliable. B4X: Dim l As List l.Initialize For c = 0 To 1000000 l.Add(c) Next File.WriteList(File.DirApp,"out.txt",l) Dim l2 As List = File.ReadList(File.DirApp,"out.txt") Log(l2.Get(0)) Log(l2.Get(l2.Size-1))