ACSet
ACSet = ConstantValue
 
Parameters: NONE
Returns: NONE
 

     PlayBasic's Auto Counter commands will help you to create structures or unique tokens.

     Assign a constant value to ACSet. The following calls to AC() will return this value and increase it afterwards.




FACTS:


      * As of PlayBasic V1.64M you can set the Auto Counter, either through an assignment to ACset or to AC. Making the following (Ac= 10) identical to using AcSet =10




Mini Tutorial:


      Showing the use of AC, ACSet and ACReset

  
; Set the Auto Counter to 0
  ACReset
  
; Use AC multiple times, increasing auto counter by 1 each time
  Print AC(1)
  Print AC(1)
  Print AC(1)
  
; Set the Auto Counter to 10
  ACSet = 10
  
; Since the auto counter is evaluated at compile time,
; you can assigned its values to constants as well
  Constant Play_Mode = AC(2)
  Constant Menu_Mode = AC(2)
  
  Print Play_Mode
  Print Menu_Mode
  
; Display the screen and wait for a key to be pressed
  Sync
  WaitKey
  


This example would output.

  
  0.0
  1.0
  2.0
  10
  12
  


 
Related Info: AC | ACReset :
 


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