November 21, 2017, 03:55:12 PM

Author Topic: [bmx] Type shortcuts by Pineapple [ 1+ years ago ]  (Read 173 times)

Offline BlitzBot

  • Newbie
  • *
  • Posts: 0
[bmx] Type shortcuts by Pineapple [ 1+ years ago ]
« on: June 29, 2017, 12:28:43 AM »
Title : Type shortcuts
Author : Pineapple
Posted : 1+ years ago

Description : Because not all of them are documented, and I find them useful.

Code :
Code: BlitzMax
  1. @ - Byte
  2. x@ is the same as x:Byte
  3.  
  4. @@ - Short
  5. x@@ is the same as x:Short
  6.  
  7. % - Int
  8. x% is the same as x:Int
  9.  
  10. %% - Long
  11. x%% is the same as x:Long
  12.  
  13. # - Float
  14. x# is the same as x:Float
  15.  
  16. ! - Double
  17. x! is the same as x:Double
  18.  
  19. $ - String
  20. x$ is the same as x:String


Comments :


dw817(Posted 1+ years ago)

 Very nice ! I've been needing to see this.


Floyd(Posted 1+ years ago)

 x## is also Double.And a reminder, numeric literals also have a type. It is assumed to be Int for integer values ( no decimal point ) and Float for floating point.
Code: [Select]
Print 123456123456
Print 123456123456%%
Print
Print 0.3
Print 0.3!