Posts

Showing posts from October, 2014

Careful with IIF in VB.NET

In VB.NET, We generally use ternary operator, IIF. Today we came across with some atypical behaviors. Dim a As Boolean = True Dim b As Integer = 1 Dim c As Integer = Nothing Dim d As Integer = CInt(IIf(a = True, b = 3, c.ToString())) What is the result? It throws error. Null cannot be converted to string. But if we use same statements with IF..ELSE, it will give you correct result. If (a = True) Then b = 3 Else Response.Write(c.ToString()) End If It works fine. First observation: In IIF, it evaluates both true and false conditions. That’s why it gives error. Another example: Dim a As Boolean = True Dim b As Integer = 1 Dim c As Integer = 2 Dim d As Integer = CInt(IIf(a = True, b = 3, c=4)) What is the value of B now? It should be 3, right? But, it will be 1. Yes One  Second observation: a= true is right, so it goes to b=3 statement. But it won’t consider it as assignme

Telugu bhasha

Aamani thari kosari koosedi koyala kannanu,, Muddhulolikedi javarali momvi kanna teeyanadhi mana mathru bhasha, telugu bhasha. Don't ignore our telugu language. Learn it, teach it.

Manchi padhyam

Thananu telusukunnavadu thathvagnudu Paruluni telusukunnavadu paramagnudu Anthu teleyadhannavadu aathmagnudu Anni telusu anukunnavadu alphagnudu

My thoughts

Suddenly I got this in my mind: In his speech, Obama said - There is No north america, No south america, No latin america, No asian america. Only one that is Unites States of America. We are one people, all of us pledging allegiance to the stars and stripes, all of us defending the United States of America. But in India, We are for state's and religion wise. This should change.