The GetBankQuantity function returns the current max number of memory banks that PlayBASIC will allow.
FACTS:
* You can expand the number of banks by using the BankQuantity command. Although we recommend you use dynamic allocation when creating banks via NewBank()
Mini Tutorial:
This example runs through and creates all available banks (the default limit),it then resizes then internal max and displays the info back to the user.
; Read and display the current Max number of banks quantity=GetBankQuantity() Print "Starting Number of Memory Banks:"+Str$(quantity) Print "press any key" ; run through and create all the available banks For lp =1 To quantity CreateBank lp,10+lp Next ; Show the user the screen and wait for a key to be pressed Sync WaitKey WaitNoKey ; Tell PB to expand the number of available memory banks BankQuantity quantity+2000 ; read and display the number of memory banks after expansion quantity=GetBankQuantity() Print "Starting Number of Memory Banks:"+Str$(quantity) Print "press any key" ; This code this loops and displays the status and size of y=0 For lp =1 To quantity If GetBankStatus(lp) size=GetBankSize(lp) Print "Bank Status:"+Str$(lp)+" Size:"+Str$(size) Else Print "Bank Status:"+Str$(lp)+" Doesn't Exist Yet" EndIf If GetCursorY()> 440 Print "Press Any Key to Show next page" SetCursorY 0 Sync WaitKey WaitNoKey Cls RGB(0,0,0) EndIf Next ; Display the Screen and wait for the user to press a key Sync WaitNoKey |
This example would output (This depends upno what version of PB your running, so the result may differ). Starting Number of Memory Banks:1024 press any key Starting Number of Memory Banks:3024 press any key Bank Status:1 Size:11 Bank Status:2 Size:12 Bank Status:3 Size:13 Bank Status:4 Size:14 Bank Status:5 Size:15 etc etc etc |
|