Topic: math and default value

if i set a default value of 0 in a text  box and then use it in a math expression  like edit1=edit1 + 1 what is the value of edit1 the next time i run the program.  what is the value of the table field it represents. does it go back to 0 or maintain the computed value?

Re: math and default value

Sorry for delay, I was on vacation.
The question is still relevant for you?

Dmitry.

Re: math and default value

yes and to expand on the question further, does the same go for default values in an integer field in a table. is the value always 0 or only 0 if it has not been changed. do the calculations in a calculated field assume they are being done  in other words i cant do calculations on a field that hasnt had a value placed there byh some means.  sorry for the basic questions but this is pretty new and i havent been able to dig up the answers any place else.  thanks for all of your help.

lee

Re: math and default value

Unfortunately I can't understand what exactly you want to do, please do some project for example.

Dmitry.

Re: math and default value

Hi Lee,
A couple of things to mention.
CALCULATED fields are just containers to temporarily hold the result of calculations based on actual data fields (it avoids data redundancy).  Look at the attached screenshot  - 'calcarea' is defined in the table 'lee' in MVD, but doesn't exist in SQLiteStudio (the raw data).  And because it doesn't actually exist, it will always get re-calculated when you next run your program.
Default values, on the other hand, are what you want the initial value of an actual data field to be and will either get saved as that default value or saved with an amended value (either by input or by calculation).  But in either case, the data IS actually saved. 
Therefore, if a field is saved with it's default value, what you see next time round is the SAVED value and NOT the re-set default value (even though they may happen to be one and the same).
Knowing your project a bit, I think I can see what lies behind your questions and I hope this has clarified rather than confused matters - LOL!
Derek.

Post's attachments

Attachment icon lee calc.jpg 198.47 kb, 281 downloads since 2016-05-16 

Re: math and default value

hi Derek

once again you got what i needed to know.  thanks for the info. i think you are getting to know my project better than me. i am  learning some along the way but a lot is confusing. it would be nice to go one on one with someone and get some instruction but i dont know where i would get it around here without actually going back to school and i am both too old and too poor to attempt that.  thanks again for your help.

lee