CopyBankBytes
CopyBankBytes SrcBank, StartAddress, EndAddress, DestBank, DestAddress
 
Parameters:

    SrcBank = The index of the bank you wish to copy
    StartAddress = The Starting source offset win the source bank
    EndAddress = The Ending source offset win the source bank
    DestBank = The index of a free bank you wish to copy to
    DestAddress = The Destination address in the dest bank
Returns: NONE
 

      CopyBankBytes Copy a run of bytes from one bank to another.



FACTS:


      * none



Mini Tutorial:


      This example creates a bank, fills it with some values, then uses CopyBankBytes to copy some bytes from the source to destination bank.



  
  
; Create bank with 15 bytes in it
  SrcBank=NewBank(15)
  
; fill the source bank with some values
  Print "Showing Contents of Bank #"+Str$(SrcBank)
  For lp=0 To GetBankSize(SrcBank)-1
     PokeBankByte SrcBank,lp,100+lp
     Print "   "+Str$(PeekBankByte(SrcBank,lp))
  Next
  
; Create another Bank with space for 5 bytes
  DestBank=NewBank(5)
  
; copy bytes 5 to 10 from bank SrcBank to the DestBank
  CopyBankBytes   SrcBank,5,10,DestBank,0
  
  Print "Showing Contents of Bank #"+Str$(DestBank)
  
; display the copied bank
  For lp=0 To GetBankSize(DestBank)-1
     Print "    "+Str$(PeekBankByte(DestBank,lp))
  Next
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  
  


This example would output.

  
  Showing Contents of Bank 10
  100
  101
  102
  103
  104
  105
  106
  107
  108
  109
  110
  111
  112
  113
  114
  
  Showing Contents of Bank 20
  105
  106
  107
  108
  109
  
  

 
Related Info: CopyBank | CopyMemory | CreateBank | GetBankPtr | GetBankSize | NewBank | Pointer :
 


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