Rusty Well-Known Member Licensed User Longtime User May 13, 2013 #1 I have just upgraded to 2.7 and am compiling a program that has been running under the previous versions of the compiler just fine. Now I am receiving an "Object reference not set ot an instance of an object." on a type structure: Code: Type MRN(MRNID As String, FirstName As String, LastName As String, DOB As String) Dim MRNInfo(100) As MRN In the code the following generates the above mentioned error: Code: For ii = 0 to 10 MRNInfo(ii).Initialize MRNInfo(ii).MRNID = "" '<---<< this line generates the error next However, the below code works fine... Code: Dim M As MRN M.Initialize M.MRNID = "" I don't understand why this is happening. Any thoughts would be greatly appreciated. Rusty
I have just upgraded to 2.7 and am compiling a program that has been running under the previous versions of the compiler just fine. Now I am receiving an "Object reference not set ot an instance of an object." on a type structure: Code: Type MRN(MRNID As String, FirstName As String, LastName As String, DOB As String) Dim MRNInfo(100) As MRN In the code the following generates the above mentioned error: Code: For ii = 0 to 10 MRNInfo(ii).Initialize MRNInfo(ii).MRNID = "" '<---<< this line generates the error next However, the below code works fine... Code: Dim M As MRN M.Initialize M.MRNID = "" I don't understand why this is happening. Any thoughts would be greatly appreciated. Rusty
Erel B4X founder Staff member Licensed User Longtime User May 13, 2013 #2 I'm unable to reproduce it. Can you upload your project or send it to me by mail? Upvote 0
Rusty Well-Known Member Licensed User Longtime User May 13, 2013 #3 I think I figured it out... In preparing a sample program to send to you for your evaluation, I discovered that the previous compiler will allow a module name and a variable name to be the same. The new compiler won't. For example: Within the module name MRN Code: Type MRN(MRNID As String, FirstName As String, LastName As String, DOB As String) Dim MRNInfo() As MRN Causes the above error In creating the test program, I discovered that Code: Type MRNx(MRNID As String, FirstName As String, LastName As String, DOB As String) Dim MRNInfo() As MRNx does work. Thanks Erel, Rusty Upvote 0
I think I figured it out... In preparing a sample program to send to you for your evaluation, I discovered that the previous compiler will allow a module name and a variable name to be the same. The new compiler won't. For example: Within the module name MRN Code: Type MRN(MRNID As String, FirstName As String, LastName As String, DOB As String) Dim MRNInfo() As MRN Causes the above error In creating the test program, I discovered that Code: Type MRNx(MRNID As String, FirstName As String, LastName As String, DOB As String) Dim MRNInfo() As MRNx does work. Thanks Erel, Rusty