|
ResizeBank | ||
ResizeBank BankIndex, NewSize | ||
Parameters: BankIndex = The Index Identifier of the bank that you wish to create. NewSize = The new size in bytes of this memory bank |
||
Returns: NONE | ||
The ResizeBank command lets us change the size of a previously created memory bank. The resize process preserves the existing contents of the bank, providing the bank is expanded. If you shrink the bank, then any excess data, which is data beyond the new size, will of course be lost. FACTS: * When resizing a bank the location of the bank in memory will most likely be altered. So if you need a raw pointer to the memory inside the bank, then it's best to refresh your pointer to the bank (GetBankPtr) after a resize. Otherwise you risk pointing at a section of memory your program no longer owns, which will most likely crash your application. Mini Tutorial: In this example, we create a bank and fills the bank full of bytes. once we've done that we've something to resize in order to show what ResizeBank does. So the program first resizes the bank down to 10 bytes and displays the contents, then rpeats the process but this time resizing it to 20 bytes.
This example would output.
|
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |