Καλώς ορίσατε στο dotNETZone.gr - Σύνδεση | Εγγραφή | Βοήθεια
σε

 

Αρχική σελίδα Ιστολόγια Συζητήσεις Εκθέσεις Φωτογραφιών Αρχειοθήκες

Παρουσίαση με Ετικέτες

Όλες οι Ετικέτε... » Bugs » Functions   (RSS)
  • VB gotcha: when If function isn’t equivalent to an If-Then-Else block

    Just got bitten by the following: Dim takeN As Integer = If(Integer.TryParse(EdTake.Text, takeN), takeN, itemsCount) I had used that instead of writing in 2 lines: Dim takeN As Integer If not Integer.TryParse(EdTake.Text, takeN) then takeN = itemsCount However, there’s an important difference: “If” is a function, so its arguments are evaluated at ...
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Νοεμβρίου 25, 2011
Με χρήση του Community Server (Commercial Edition), από την Telligent Systems