Ok, now for the harder bit... This bit is about the use of StoreValue, and RestoreValue.
a) they are not complimentary functions. In other words, one is not the opposite of the other. They perform 2 separate roles, and their behavior is not related to each other. Indeed RestoreValue is only used in a small number of special cases, and you should not need to use it much, if ever. On the other hand StoreValue is very useful, and something that should definitely be in your arsenal.
b) a "Value" in much of my discussion refers to a specific parameter passed in via the browser request. There are 3 "ways" a parameter can be sent - in the URL itself, as a cookie, or as POST data. Regardless of the way, NetTalk parses all 3 out for you and stores these in the "ValueQueue". Functions like GetValue, SetValue and IfExistsValue are all common when dealing with the Value queue.
c) The danger with Values, especially fi you are new to web programming, is understanding when they are _not_ available. Consider the following case;
1) a Form is called, with a bunch of Values as parameters
2) The user clicks on a lookup button, selects a record, then "returns to" the form by clicking Select.
3) At this point the original Values _do not exist_. Because the parameters passed from the _lookup_ browse are different to the values passed from the _original_ browse.
Thus it would be dangerous to use the _GetValue_ method at anytime during the Form. Instead you make sure he Value is in the SessionQueue, and use GetSessionValue instead.
Ok, here's the crucial bit...
the most common technique folk used for storing the Value was
p_web.SSV('parameter',p_web.GetValue('parameter'))
But this is wrong. why? Because if the parameter _does not exist_ then the _session value_ will be cleared. The correct way to write this code would be
If p_web.IfExistsValue('parameter')
p_web.SSV('parameter',p_web.GetValue('parameter'))
End
Since I got tired of writing this out all over the place, I created a single method call which effectively just does these 3 lines. ie
p_web.StoreValue('parameter')
helpful?
Cheers
Bruce