delete the memory

dezreena

Member
Joined
Mar 29, 2007
Messages
20
Programming Experience
Beginner
hye guys..
i have problems with my programm.This are the codes..

'##############################

public class EndErgebnisse

public Structure Ergebnisse1

public Angebot as Double
public AnzahlForderung as Double
public Mitt_Bedzeit as Double

Sub berechnen

Angebote = AnzahlForderung / Mitt_Bedzeit

End Sub


sub züruck_click (button)

Me.finalize

End sub

End Structure

End Class
###################################################

what i want is , the value of Angebote will be erase after i click the zurück button for the next simulation.
did anyone have any idea , how to make it right?

i have try with disposed and finalize and even refresh.. but still not working..
plz somebody help me.. :)
 
You want the class object to destroy itself and create a new instance of itself? You should do that from the code where you make the instance of the class, not in the class itself...
Otherwise, just Angebote=0?
 
hello martin..

You should do that from the code where you make the instance of the class, not in the class itself...
?

i dont understand. can u make a simple example for me?

by clicking zurück_button, i want the angebot value will be = 0 again.
so that for restarting the programm, everything will be = 0 .
 
Is the class EndErgebnisse a Form?
In that case I would say simply put
Angebot=0
In the onclick event of the button.

Otherwize:

Dim myClass as new EndErgebnisse
myClass.AnzahlForderung = [some value]
myClass.Mitt_Bedzeit = [some value
myClass.berechnen
myClass = nothing

If this is not what you're looking for, please post more code, so I can get a clear picture.
 
hye guys..
i have problems with my programm.This are the codes..

'##############################

public class EndErgebnisse

public Structure Ergebnisse1

public Angebot as Double
public AnzahlForderung as Double
public Mitt_Bedzeit as Double

Sub berechnen

Angebote = AnzahlForderung / Mitt_Bedzeit

End Sub


sub züruck_click (button)

Me.finalize

End sub

End Structure

End Class
###################################################

what i want is , the value of Angebote will be erase after i click the zurück button for the next simulation.
did anyone have any idea , how to make it right?

Because it is a Double, you cannot set it to null. Declare it as Nullable(Of Double) and set it to Nothing in zuruck

http://www.c-sharpcorner.com/Upload...rticleID=9ef3d50b-621f-4496-858f-a468033cd93b


VB.NET:
public angebot as Nullable(Of Double) = Nothing
 
sub züruck_click (button)
 
  angebot = Nothing
 
End sub

Do not use PascalCase for variable names, use camelCase
 
Back
Top