We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
See https://docs.microsoft.com/en-us/dotnet/visual-basic/programming-guide/program-structure/special-characters-in-code#exclamation-point--operator
Should probably have an Imports statement or two:
Public Class hasDefault Default Public ReadOnly Property index(ByVal s As String) As Integer Get Return 32768 + AscW(s) End Get End Property End Class Public Class testHasDefault Public Sub compareAccess() Dim hD As hasDefault = New hasDefault() MsgBox("Traditional access returns " & hD.index("X") & vbCrLf & "Default property access returns " & hD("X") & vbCrLf & "Dictionary access returns " & hD!X) End Sub End Class
using Microsoft.VisualBasic; using Microsoft.VisualBasic.CompilerServices; public partial class hasDefault { public int this[string s] { get { return 32768 + Strings.AscW(s); } } } public partial class testHasDefault { public void compareAccess() { var hD = new hasDefault(); MsgBox["Traditional access returns " + Conversions.ToString(hD["X"]) + Constants.vbCrLf + "Default property access returns " + Conversions.ToString(hD["X"]) + Constants.vbCrLf + "Dictionary access returns " + Conversions.ToString(hD.X)]; } }
using Microsoft.VisualBasic; using Microsoft.VisualBasic.CompilerServices; public partial class hasDefault { public int this[string s] { get { return 32768 + Strings.AscW(s); } } } public partial class testHasDefault { public void compareAccess() { var hD = new hasDefault(); Interaction.MsgBox("Traditional access returns " + Conversions.ToString(hD["X"]) + Constants.vbCrLf + "Default property access returns " + Conversions.ToString(hD["X"]) + Constants.vbCrLf + "Dictionary access returns " + Conversions.ToString(hD["X"])); } }
The text was updated successfully, but these errors were encountered:
745007a
GrahamTheCoder
No branches or pull requests
Input code
See https://docs.microsoft.com/en-us/dotnet/visual-basic/programming-guide/program-structure/special-characters-in-code#exclamation-point--operator
Should probably have an Imports statement or two:
Erroneous output
Expected output
The text was updated successfully, but these errors were encountered: