Ja, ich weiß, wer noch VB2010 nutzt ist selbst Schuld.
Ich habe diese Woche ein interssantes Problem gehabt:
Hat ein bissel gedauert bis ich das Problem erkannt hatte.
Gibt es irgdendwo eine Auflistung von Problemen die der Kompiler so hat?
Ich habe diese Woche ein interssantes Problem gehabt:
VB.NET-Quellcode
- Dim _s As String = "00FFF70000"
- Dim _srt As Short = Convert.ToInt16(_s.Substring(2, 4), 16)
- '-> _srt = &HFFFFFFF7
- Dim _i As Integer = Convert.ToInt32(_s.Substring(2, 4), 16)
- '-> _i = &HFFF7
- Dim _l1 as Long = Convert.ToInt64(_srt)
- '-> _l1 = &HFFFFFFFFFFFF7
- Dim _l2 as Long = Convert.ToInt64(_i)
- '-> _l2 = &HFFF7
- 'Mit VB2010 funktioniert nachfolgendes also nicht:
- Dim _l As Long = Convert.ToInt64(_s.Substring(2, 4), 16)
- '-> _l = &HFFF7
- 'Mit VB2017 wird alles korrekt konvertiert:
- Dim _l As Long = Convert.ToInt64(_s.Substring(2, 4), 16)
- '-> _l1 = &HFFFFFFFFFFFF7
Hat ein bissel gedauert bis ich das Problem erkannt hatte.
Gibt es irgdendwo eine Auflistung von Problemen die der Kompiler so hat?