Wish Integer = Int

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
For those of us who switch back-and-forth between Visual Studio and B4A regularly, could you make the variable type "Integer" equivalent "Int" for declarations, e.g.
B4X:
Dim MyVar as Integer   ' Same as Dim MyVar as Int
Or alternatively, perhaps you could make your Intellisense look for "As Integer" and automatically change it to "Int" on Enter key/space bar?

I know my backspace key would appreciate it ;)
 

JakeBullet70

Well-Known Member
Licensed User
Longtime User
Your best bet now is to high-lite the text you want to change, hit F3 and do a search and replace.
 

Widget

Well-Known Member
Licensed User
Longtime User
@LucaMs - I wasn't suggesting changing "Int" to "Integer", I was suggesting having it be equivalent (i.e. you can use either one interchangeably).

I think yours is a reasonable request that could be easily handled by the B4A compiler. It would see "Integer" and convert it to "Int". I too thought using "Int" was a bit odd when every other language I've used would use "Integer". It would make B4A more compatible with other languages and make converting from another language easier with copy and paste. Also I would not have to retrain my fingers to prevent them from typing "Integer" all the time, especially when switching between languages in the same day. :)
 

Widget

Well-Known Member
Licensed User
Longtime User
Java uses Int !

Java may be using Int, but we're programming in Basic. ;)
It would be desirable to keep the same standard Basic data types for compatibility with other Basic languages.
 

LucaMs

Expert
Licensed User
Longtime User
Well, I don't see the problem, whatever language you use today, the dev tools "suggest" the right type name; you must only know their purpose and their limit.

I don't see Erel's answers and I think he will not make this "change" (btw, I don't know why he rarely answers the Wishes; I would alway answer something).
 

ilan

Expert
Licensed User
Longtime User
I have to change all Integer to Int (my Map #2)

i think what @Jeffrey Cameron mean is if you type dim i as integer and then hit the return button the ide will automatically change "integer" to int
so you wont have to change anything because the result will still be "int" only instead of giving an error it will change "integer" to int.

i like the idea :)
 
Top