Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Saving the last value of variable

Saving the last value of variable

Scheduled Pinned Locked Moved Visual Basic
questiondatabasehelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Ahuva
    wrote on last edited by
    #1

    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

    C 1 Reply Last reply
    0
    • A 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

      C Offline
      C Offline
      chris foote
      wrote on last edited by
      #2

      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]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups