If count is zero and index is one, then PBCC apparently (based on the amount of time taken) attempts to sort the entire allocated array ... no matter how big that is. For example, the following program has a long wait between the two print statements. If there are no elements to sort, I would expect array sort to run extremely fast and therefore consider this a bug.
#STACK 4194304
type t_XCH
SK as string*27
xty as long
end type ' t_XCH
global mXCH as long, nXCH as long, XCH() as t_XCH
function PBMAIN as long
mXCH = 1048576
nXCH = 0
redim XCH(mXCH)
print "sorting empty array ..."
array sort XCH(1) for nXCH, ascend
print "... sorted empty array"
end function
#STACK 4194304
type t_XCH
SK as string*27
xty as long
end type ' t_XCH
global mXCH as long, nXCH as long, XCH() as t_XCH
function PBMAIN as long
mXCH = 1048576
nXCH = 0
redim XCH(mXCH)
print "sorting empty array ..."
array sort XCH(1) for nXCH, ascend
print "... sorted empty array"
end function
Comment