Byte
 


      Byte is not actually a command. It's a keyword used to declare an item as being Byte data type. Namely used with Types





FACTS:


      * Byte values are 8bit and have a numeric range of 0 to 255

      * Byte can only be used with Pointers & Type Fields in PlayBASIC V1.64 and bellow, there is no support Byte variables at this time.





Mini Tutorial:


      This example shows some valid usages of Byte today.

  
; Declare a Byte Pointer of (a pointer to read/write byte values)
  Dim MyPointer As Byte Pointer
  
; Create a bank
  CreateBank 1,100
  
; Get the address of this bank and store it in MyPointer
  MyPointer=GetBankPtr(1)
  
; Use this pointer to write some byte values to a bank
  For lp=0 To 10
     *MyPointer=lp
     MyPointer=MyPointer+1
  Next
  
; Get the address of this bank and store it in MyPointer again
  MyPointer=GetBankPtr(1)
  
; Use this pointer to reads the values from the bank
  For lp=0 To 10
     Print *(MyPointer+lp)
  Next
  
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  




This example would output.

  
  0
  1
  2
  3
  4
  5
  6
  7
  8
  9
  10
  

 
Related Info: Dim | Float | Global | Integer | Local | Memory | Pointer | Static | Type | Word :
 


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