What is %?
BlitzMax Forums/BlitzMax Beginners Area/What is %?
| ||
What does % mean when declaring a variable? For example: Global curGetKey% |
| ||
Its a symbol which means Integer: % = Int # = Float $ = String ! = Double Shortcuts really :P Last edited 2011 |
| ||
also:Type TMyType Field a@ 'byte Field b@@ 'short Field c% 'int Field d%% 'long Field e# 'float Field f## 'double Field g! 'double Field h$ 'string End Type Local id:TTypeId=TTypeId.ForName( "TMyType" ) For Local fld:TField=EachIn id.EnumFields() Print fld.Name()+":"+fld.TypeId().Name() Next |
| ||
Each person has his own style, but personally I prefer to avoid using these symbols. I program in Strict mode, so a variable without a type defaults to int so there is no extra typing anyway, as most variables are int. |
| ||
Plus programming in strict mode saves a lot of time debugging (traps typing errors with different variable types). It's best to stay away from cryptic symbols as byte,short,int,long, etc is more readable than @,@@,%,%%, etc. |