Click here to Skip to main content
15,867,686 members
Articles / Programming Languages / Visual Basic
Tip/Trick

A tip/trick about Type Character

Rate me:
Please Sign up or sign in to vote.
5.00/5 (3 votes)
3 Feb 2011CPOL 13.7K   2
Type Character
While looking at some old code, I found surprising behavior in my IDE.

I found value = -1000.25623! in the code. I changed the value to -1000.25626 and it automatically changed to -1000.25629.

I tried to search what it could be with no success. Then I suddenly pointed at ! and found the tooltip.

Single
Represents a single-precision floating-point number.


So ! was representing a single value. The above line represents the following block.
VB
Dim temp As Single
Dim value As Double
temp = -1000.25626
value = temp


More Type Characters[^] [Thanks to Dave[^]]

*It may not be a tip/trick, but it is definitely the piece worth sharing.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
India India
Working since 2006 on VBA, VB6, VB.Net, C#, ASP.Net, MSSQL




  • Courage is not the absence of fear, but rather the judgement that something is more important than fear.
  • The fear of suffering is worse than the suffering itself.
  • People need not fear the unknown if they are capable of achieving what they need and want.
  • Every blessing ignored becomes a curse.
  • Sometimes what's in your head isn't as crazy as you think.
  • We never really grow up, we only learn how to act in public.
  • You can make very bad teams with very good individuals.
  • Admitting mistakes means you have a sense of responsibility in your actions and that shows you are more matured than almost anyone. -Nithin


Comments and Discussions

 
GeneralThe subject of your Tip Pin
Henry Minute31-Jan-11 4:21
Henry Minute31-Jan-11 4:21 
GeneralRe: The subject of your Tip Pin
Prerak Patel31-Jan-11 4:25
professionalPrerak Patel31-Jan-11 4:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.