WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: juergenk on June 02, 2022, 06:46:06 AM

Title: 1591: Fleread: line to long
Post by: juergenk on June 02, 2022, 06:46:06 AM
Hello guys,

i will read an very long line in Files how i can do this ?

greetings
juergen

filename = "E:\a\Projekt GL NEU\FB\bed.htm"
arrFile = ArrayFileGet (filename , "" , 0)
linecount = ArrInfo(arrFile,6)
For x = 0 to linecount-1
  line =  arrFile
Title: Re: 1591: Fleread: line to long
Post by: td on June 02, 2022, 06:54:35 AM
The solution depends on what exactly the "this" is you are trying to perform. If you are referring to parsing out the contents of a file, WinBatch offers several ways of performing that task including loading the file into a binary buffer. If you are referring to displaying the contents of a portion of a file, WinBatch offers several ways of performing that task too. For example, you could consider creating a WIL dialog.

Also, you can control the maximum file line length with IntControl 65. Check it out in the Consolidated WIL Help file on your system or by going to the WinBatch Documentation Website.
Title: Re: 1591: Fleread: line to long
Post by: JTaylor on June 02, 2022, 07:04:12 AM
intcontrol 65?

Jim
Title: Re: 1591: Fleread: line to long
Post by: stanl on June 02, 2022, 10:48:51 AM
Maybe off topic. But why read an .htm file line by line. There are parsers and components that might produce results [not specified in original post]... conducive to a goal.
Title: Re: 1591: Fleread: line to long
Post by: td on June 02, 2022, 01:20:45 PM
Quote from: JTaylor on June 02, 2022, 07:04:12 AM
intcontrol 65?

Jim

It is in the help file and ...

https://docs.winbatch.com/mergedProjects/WindowsInterfaceLanguage/html/WILAK_I__086.htm (https://docs.winbatch.com/mergedProjects/WindowsInterfaceLanguage/html/WILAK_I__086.htm)
Title: Re: 1591: Fleread: line to long
Post by: td on June 03, 2022, 01:32:01 PM
At the risk of speaking the obvious, IntControl 65 documentation only mentions the FileRead function but the same setting is used by ArrayFileGet. A new IntControl 65 setting only takes effect for files opened with FileOpen or ArrayFileGet after the call to IntControl 65.