< Futurebasic < Language < Reference

COMPRESS DYNAMIC statement

COMPRESS DYNAMIC

Statement

✔ Appearance ✔ Standard ✔ Console

Syntax

COMPRESS DYNAMIC arrayName

Revised:
May, 2001 (Release 5)

Description

When space is required for a dynamic array, it is allocated in chunks. The size of these chunks is determined by the global variable gFBDynamicGrowInc&. If gFBDynamicGrowInc& is set to 1000 and you use a single element, 1000 elements are allocated. No additional elements are allocated unless and until you pass the 1000 mark. If you needed to access the 1001st element, an additional 1000 elements would be allocated.

The preallocation of space in large chunks can make dynamic arrays operate at a much faster pace because the handle used to accommodate the information is not resized as often.

When you want to regain RAM set aside for a dynamic array that has not yet been addressed, use COMPRESS DYNAMIC. The size of the handle used to hold information is reduced. Internal counters that track the maximum number of elements available before resizing are also corrected.

See Also

DYNAMIC
READ DYNAMIC
WRITE DYNAMIC

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.