viewpoint-particle

Author Topic: FileRead function limited to 4096 bytes can this be increased; array  (Read 151 times)

guile

  • Newbie
  • *
  • Posts: 6
How can you increase the FileRead function limitation of 4096 bytes,

I know it says IntControl 65 but I cant seem to increase the size beyond 4096 bytes :'(

Im reading the string in to a variable then pulling the string in to an array but can only read in about 500 elements at a shot, not sure what to do?

;Get VendorNumbers from VendorNumber.txt
DirChange( DirScript())
fileVendorNumberstrList1=FileLocate ("VendorNumber.txt")
fileVendorNumberstrList2=FileOpen(fileVendorNumberstrList1,"READ")
fileVendorNumberstrList=FileRead(fileVendorNumberstrList2)
FileClose(fileVendorNumberstrList2)

;Convert list to an array
arrA = ObjectType ("ARRAY", Arrayize (fileVendorNumberstrList, ","))

intElements1 = ArrInfo (arrA, 1)
;
If intElements1
   intItem1 = 0
;Access each element in the array
   ForEach arrElement1 In arrA
      VendorNumber = arrA[intItem1]

      intItem1 = intItem1 + 1

;Use SendKey with Variable element from array
cSetFocus(hWnd)
TimeDelay(1)
SendKey(VendorNumber)

      Next
    End If


td

  • Tech Support
  • *****
  • Posts: 3209
    • WinBatch
Re: FileRead function limited to 4096 bytes can this be increased; array
« Reply #1 on: January 28, 2020, 10:16:52 am »
You seem to be confusing file size with file line length.  They are not the same thing.  Please reread the Consolidated WIL Help file FileRead topic and note the following comments:

"This function expects standard DOS CR-LF terminated lines in the file"

and

"the default maximum length of a line, which can be read using the FileRead function is 4096 bytes. If you need to increase the length of line that FileRead can read see IntControl 65.

and

"When the end of the file is reached, the string *EOF* will be returned."




"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

  • Tech Support
  • *****
  • Posts: 3209
    • WinBatch
Re: FileRead function limited to 4096 bytes can this be increased; array
« Reply #2 on: January 28, 2020, 10:21:15 am »
Also, technical questions about WinBatch belong in the WinBatch board and not in this Customer Support board.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade