Số cột, hàng maximum của mảng? (1 người xem)

  • Thread starter Thread starter chua123
  • Ngày gửi Ngày gửi
Liên hệ QC

Người dùng đang xem chủ đề này

chua123

Thành viên mới
Tham gia
10/5/14
Bài viết
25
Được thích
3
Giới tính
Nam
Dear các bác,
Hiện tại data của em tuong đối lớn, khoảng hơn 6000 hàng (sẽ tăng dần theo thời gian), và ~ 105 cột, em đưa data này vào mảng để xử lý, sau khi đổ ngược KQ ra bảng tinh excel, thì data hàng 6676 thì OK, còn data từ đó trở về sau của mảng bị sai, thiếu data, em không biết có bị out of range của mảng không, cột thì OK, các bác chỉ với ạ.
Em cám ơn các bác.
 
Số cột, hàng maximum của mảng?
bị out of range của mảng không?
Thông tin:
"Array Size Considerations
There are several things to keep in mind when dealing with the size of an array.

Dimension Length
The index of each dimension is 0-based, which means it ranges from 0 through its upper bound. Therefore, the length of a given dimension is greater by 1 than the declared upper bound for that dimension.

Length Limits
The length of every dimension of an array is limited to the maximum value of the Integer data type, which is (2 ^ 31) - 1. However, the total size of an array is also limited by the memory available on your system. If you attempt to initialize an array that exceeds the amount of available RAM, the common language runtime throws an OutOfMemoryException exception.

Size and Element Size
An array's size is independent of the data type of its elements. The size always represents the total number of elements, not the number of bytes that they consume in storage.

Memory Consumption
It is not safe to make any assumptions regarding how an array is stored in memory. Storage varies on platforms of different data widths, so the same array can consume more memory on a 64-bit system than on a 32-bit system. Depending on system configuration when you initialize an array, the common language runtime (CLR) can assign storage either to pack elements as close together as possible, or to align them all on natural hardware boundaries. Also, an array requires a storage overhead for its control information, and this overhead increases with each added dimension."
Nguồn: https://msdn.microsoft.com/en-us/library/b388cb5s(v=vs.90).aspx

-----------
Thử nghiệm, xem thông báo hiện ra...
PHP:
Sub vidu1()
Dim Mang(1 To (2) ^ 31)
End Sub
'Hoặc:
Sub vidu11()
Dim Mang(1 To (2) ^ 31, 0)
'Dim Mang(0, 1 To (2) ^ 31)
End Sub
'-----------
Sub vidu2()
Dim Mang(1 To (2) ^ 31 - 1, 0)
End Sub
 
Upvote 0
Web KT

Bài viết mới nhất

Back
Top Bottom