BankQuantity
BankQuantity NumberOfBanks
 
Parameters:

    NumberOfBanks = The max number of memory banks that PB should handle
Returns: NONE
 

      BankQuantity lets you expand the max number banks available. So if you ever run out of memory banks, you can request more at any time.



FACTS:


      * Bank quantity indexes is limit to 2^24 banks (over 16 million).



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
  
  
  

 
Related Info: :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com