Ok this will be a pretty small tutorial ok you know all how to declare variables in vb6 & vb .NET right
ex
but did you know that you can declare a variable in a much shorter way using symbols like thisCode:Dim TheString as String Dim Number as Integer
so i also commented each line so you know what symbol do what but let me write it downCode:Dim TheString$ 'String Dim TheInt% 'Integer Dim TheSingle! 'Single Dim TheDouble# 'Double Dim TheLong& 'Long Dim TheCurrency@ 'Currency
% - Integer
! - Single
# - Double
& - Long
@ - Currency
Ok this is the tutorial i know realy short but i hope i can get in handle for anyone of youPeace out
Last edited by kresh7; 09-18-2009 at 06:54 AM.
I've never heard of these declaration shortcuts in VB. Very good to know! +rep
This was the old way of doing it (back in basic, basicA, gwbasic, qbasic, etc...)
VB tries to support legacy commands and conventions
(with minimal to no documentation) as long as it doesn't
go against it's current direction.
I'm a nostalgia buff, so good post +rep![]()
That's a cool bit of info. +rep
Very interesting. I prefer the "as" method even though it is more typing because it reads a lot easier. When I see
I have to remember what $ means, where asCode:Dim sName$
I don't have to remember anything. It reads easier.Code:Dim sName As String
It is useful when declaring constants, though:
I'm not really a .NET person so I don't know if they fixed this, but this is the way it was done in 6 and VBA.Code:Const MyLongConst = &HFACE& Const MyIntConst = &HFACE%
sudo rm -rf /
Cool!![]()
Interested in participating in community events?
Want to harness your programming skill and turn it into absolute prowess?
Come join our programming events!
This is really cool, I never knew you could do it that way!
I would advise against it, just because it makes your program annoying to read.
sudo rm -rf /
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks