Saving the last value of variable
-
Hello !! How can I save the last value of a variable even after turning off the computer?? I have an Index (static i As Integer). THe value of the index is equal to 10, but after I quit from VB and entering again to the program, the value of the index is zero (0), again. Is there any way to solve this program ??? I hope you can help me. Any way, Thank you !!! Ahuva
-
Hello !! How can I save the last value of a variable even after turning off the computer?? I have an Index (static i As Integer). THe value of the index is equal to 10, but after I quit from VB and entering again to the program, the value of the index is zero (0), again. Is there any way to solve this program ??? I hope you can help me. Any way, Thank you !!! Ahuva
What your looking for the the propbag PropBag.WriteProperty PropBag.ReadProperty or you could put it in a recordset.. Dim rs As Recordset Set rs = New Recordset rs.CursorLocation = adUseClient rs.Fields.Append "Value", adsingle rs.open rs![value]=10 rs.save "c:\myvalue.dat" , adPersistADTG rs.close then to retrive the data Dim rs As Recordset Set rs = New Recordset rs.CursorLocation = adUseClient rs.open "c:\myvalue.dat" txtValue.text=rs![Value]