[bmx] Type shortcuts by Pineapple [ 1+ years ago ]

Started by BlitzBot, June 29, 2017, 00:28:43

Previous topic - Next topic

BlitzBot

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) Select
@ - Byte
x@ is the same as x:Byte

@@ - Short
x@@ is the same as x:Short

% - Int
x% is the same as x:Int

%% - Long
x%% is the same as x:Long

# - Float
x# is the same as x:Float

! - Double
x! is the same as x:Double

$ - String
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.
Print 123456123456
Print 123456123456%%
Print
Print 0.3
Print 0.3!