Quantcast
Viewing all articles
Browse latest Browse all 27086

VS 2010 Losing Class Variables

I have a class pro_6502 with a few private variables set as, I am assuming, globals within the class:

Code:

    Private accumulator As String = "00000000"
    Private current_address As String = "0000000000000000"
    Private current_program_counter As String = "0000000000000000"
    Private main_memory(1024) As String

I have a few functions within this class and a main form that uses this class...

Code:

Imports WindowsApplication4.pro_6502

...when needed in a sub or function, this will appear...
Dim pro = New pro_6502()

I'd like to confirm something:

I have a subroutine in the main form that uses the class by placing a value into the private variable main_memory() and at the moment I am simply focussing on main_memory(32). Ican see the data being stored and then return from the class functions back to the main form. However, when I go back in to the class to read the data at this point it is empty.

I am assuming this therefore loses scope?

If so, is there any way I can get this to hold on to the data given to it?

Viewing all articles
Browse latest Browse all 27086

Trending Articles