All Things WinBatch > Customer Service
FileRead function limited to 4096 bytes can this be increased; array
(1/1)
guile:
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:
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."
td:
Also, technical questions about WinBatch belong in the WinBatch board and not in this Customer Support board.
Navigation
[0] Message Index
Go to full version