3 Replies - 921 Views - Last Post: 27 October 2009 - 07:15 AM Rate Topic: -----

#1 rainbow evil  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 7
  • View blog
  • Posts: 308
  • Joined: 15-July 09

saving variable between uses

Posted 27 October 2009 - 05:04 AM

Hi,

I was wondering if anyone could help me with a program. I have written all that is required at this point and have published the program. I thought that global variables were saved when the program terminated but, as I found out, they aren't. If anyone has any way of making the variables keep their values between uses of the program I would be very grateful as if the program is being run for the first time some global variables need to be set straight away (I have done this code). The variable types are: one boolean and a few strings.

Thanks in advance.

This post has been edited by rainbow evil: 27 October 2009 - 05:04 AM


Is This A Good Question/Topic? 0
  • +

Replies To: saving variable between uses

#2 CharlieMay  Icon User is online

  • This space intentionally left blank
  • member icon

Reputation: 1387
  • View blog
  • Posts: 4,465
  • Joined: 25-September 09

Re: saving variable between uses

Posted 27 October 2009 - 05:20 AM

You could write the values to a textfile before the program closes and read them back in at the start of the program.
Was This Post Helpful? 0
  • +
  • -

#3 dzone41  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 46
  • View blog
  • Posts: 216
  • Joined: 21-August 09

Re: saving variable between uses

Posted 27 October 2009 - 05:59 AM

I use this:
SaveSetting("MyProgram", "Config", "NavBar", _
CStr(CBool(toolNav.Visible)))


and this:
toolNav.Visible = _
CBool(GetSetting("MyProgram", "Config", "NavBar", "True"))


This post has been edited by dzone41: 27 October 2009 - 06:00 AM

Was This Post Helpful? 0
  • +
  • -

#4 dzone41  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 46
  • View blog
  • Posts: 216
  • Joined: 21-August 09

Re: saving variable between uses

Posted 27 October 2009 - 07:15 AM

You will find good info here also:

http://www.dreaminco...wtopic72654.htm

This post has been edited by dzone41: 27 October 2009 - 07:15 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1