2 Replies - 342 Views - Last Post: 08 February 2012 - 01:29 PM Rate Topic: -----

#1 Jerrrum  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 08-February 12

Saving the value of a variable when program is closed

Posted 08 February 2012 - 07:07 AM

Hello, I am looking for an easy way to save the value of a variable when a program is closed. And then when it is reopened the variable has the same value as what it was previously when the program was closed. The variable has an integer value. Any help appreciated! Thanks.
Is This A Good Question/Topic? 0
  • +

Replies To: Saving the value of a variable when program is closed

#2 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1605
  • View blog
  • Posts: 5,162
  • Joined: 25-September 09

Re: Saving the value of a variable when program is closed

Posted 08 February 2012 - 07:12 AM

Maybe this?
Was This Post Helpful? 0
  • +
  • -

#3 DimitriV  Icon User is offline

  • They don't think it be like it is, but it do
  • member icon

Reputation: 584
  • View blog
  • Posts: 2,738
  • Joined: 24-July 11

Re: Saving the value of a variable when program is closed

Posted 08 February 2012 - 01:29 PM

Go to My Project -> Settings and add a new item named myInteger. Set the Data Type to Integer from the ComboBox. Set the value to 0.
Now in your project, refer to it programmatically like this:
My.Settings.myInteger = 48

Which sets that value to 48 and saves it for next time.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1