Q: I am getting 'out of memory' error using an array in my SQR on a PC. Why?

A: Out of memory errors on PC DOS, PC Windows, or any other 16 bit operating systems may be caused if the total size of your array exceeds 64K bytes. Example using an array:

	create-array name=big_array size=7000
	field=name1:char
	field=name2:char:13
	field=name3:number
	field=name4:char:13

In this example 64K = 64 x 1024 bytes = 65,536 bytes available. Each CHAR uses 6 bytes, therefore 65,536 / 6 bytes = 10,920 possible array rows; each NUMBER uses 8 bytes, therefore 65,536 / 8 bytes = 8,190 possible array rows. In our example, the big_array with 7000 rows requires:

        (7000 rows) x (6 bytes per CHAR type) x (13 occurences) = 546,000 bytes

    This by far exceeds the maximum of 65,536 bytes.