fork download
  1. Imports System
  2.  
  3. Public Class Test
  4. Public Shared Sub Main()
  5. Console.WriteLine(GetColumnNumber("B"))
  6. End Sub
  7.  
  8. Public Shared Function GetColumnNumber(name As String) As Integer
  9. Dim number As Integer = 0
  10. Dim pow As Integer = 1
  11. For i As Integer = name.Length - 1 To 0 Step -1
  12. number += (name(i) - "A"C + 1) * pow
  13. pow *= 26
  14. Next
  15.  
  16. Return number
  17. End Function
  18. End Class
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Visual Basic.Net Compiler version 0.0.0.5914 (Mono 2.4.2 - r)
Copyright (C) 2004-2008 Rolf Bjarne Kvinge. All rights reserved.


/home/1fjYeN/prog.vb (12,32) : Error VBNC30452: Operator '-' is not defined for the types 'System.Char' and 'System.Char'.
/home/1fjYeN/prog.vb (12,32) : Error VBNC30452: Operator '-' is not defined for the types 'Char' and 'Char'.
There were 2 errors and 0 warnings.
Compilation took 00:00:00.9433080
stdout
Standard output is empty