Property Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

does a property keep its value even when a program is turned off

for instance if i make a class
account
with a property of account name
will it keep that value when i turn off the program

WStoreyII
 
Only if it returns a constant. Otherwise, no.

To do so you would have to serialize the object and write it to disk (or
another medium for storage)
 
If property is set by the user, than you'd have to persist it somehow,
either serialize it or store it in a DB or the registry to be able to get it
Property values are stored in RAM so once the program closes, that space is
cleared out. So the only way you'd get the value again is if it was
persisted or it always returned the same thing.
 
Hi WStoreyII

When you start your program again a complete "New" object (class) is
created.
You are not connecting to your old program.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top