PROKA Posted October 1, 2004 Posted October 1, 2004 The old System.NullReferenceException still gives me headaches :) here's my code Public Class Whatever Public Class Member Public name As String Public age As Integer End Class Dim membri(0) As Member Public Sub A_Sub() membri(0).name = "Test" End Sub End Class Whenever I call the A_Sub method, I get a system.nullreferenceexception reffering to that line membri(0).name = "Text" . What should I do Quote Development & Research Department @ Elven Soft
Administrators PlausiblyDamp Posted October 1, 2004 Administrators Posted October 1, 2004 You need to instantiate the object at position 0 in the array. Public Class Whatever Public Class Member Public name As String Public age As Integer End Class Dim membri(0) As Member Public Sub A_Sub() membri(0) = new Member() membri(0).name = "Test" End Sub End Class Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Administrators PlausiblyDamp Posted October 1, 2004 Administrators Posted October 1, 2004 Does the array .answers contain anything at all? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
PROKA Posted October 1, 2004 Author Posted October 1, 2004 Does the array .answers contain anything at all? Oh , Thanks, I deleted my message while u were replying, because I figure it out by myself ... thanks a lot, again Quote Development & Research Department @ Elven Soft
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.