All Things WinBatch > WinBatch

Declaring Variables

(1/3) > >>

bottomleypotts:
I have a need to read through a file greater that 3Gb.


--- Code: Winbatch ---a=Int64(2999947537)

x=500000000

For i=0 to a-1 by x
        ; do something
Next i
 
I know that I will have to do this as a while loop, but it would be nice to be able to explicitly declare i as an int64. Can anyone think of a way to do this?

stanl:
Not sure I understand what is being read but you might want to look into WB's BinaryReadEx() function with this parameter


file-offset: zero-based offset into the file specifying where the data to be read starts. This parameter accepts a huge number or a 64-bit integer data type.


bottomleypotts:
Stan, run the code. My issue is i is an integer and ends up being negative.

JTaylor:
Will ObjectType() do what you need?

Jim

stanl:

--- Quote from: bottomleypotts on September 12, 2021, 04:35:06 am ---Stan, run the code. My issue is i is an integer and ends up being negative.

--- End quote ---


Sorry, it was early in the morning and I was more focused on how a large file could be read, but for variable assignment, Jim's suggestion is probably correct.

Navigation

[0] Message Index

[#] Next page

Go to full version