I'm sure that I don't fully understand variables and would like some advice.
Suppose I have a Form procedure on which I want to display messages based on data entered. A message might be: 'Rotational mass (kg) min = 1% of vehicle weight, max = 30% of vehicle weight, set to default'. This is just informational. It is not stored in a database.
For this case can I declare a Local Variable - loc:message1, set it in the server side code and create the session variable viz:
if <certain conditions apply>
loc:message1 = 'Rotational mass (kg) min = 1% of vehicle weight, max = 30% of vehicle weight, set to default'
else
loc:message1 = ''
end
p_web.ssv('loc:message1',loc:message1)
Then, if I Reset Message1 on the Form this should be ok.
But my question is whether there is any possibility that loc:message1 will get changed by another 'user' between when my code decides to post the above message and the execution of the p_web.ssv?
This question stems from the fact that the exe is being used by many users (and all have access to loc:message1). But if server side code is triggered can that code ever be interrupted or does it always run to completion? If it always completes before control is passed to another request then loc:message would be safe.
But suppose the server side code contains an IO loop which raises the possibility that the exe will get scheduled off the CPUs will it still run to completion before control is relinquished? If it does (and loc:message1 is still safe) then that raises the question of the responsiveness of the exe which depends on request being handled in short time frames - but it is possible to write code in the server side that runs for 5 minutes and that would destroy responsiveness for other requests unless it was interrupted (which would make loc:message1 unsafe).
So, more questions than answers in my head - your advice and experience will be appreciated.
Note: When I started this 'message' business I used a file variable but then discovered that if I wanted the message available on multiple tabs then I had to have multiple file variables which seemed cumbersome and perhaps unnecessary. The above question arises out of my desire to limit file variables (And if someone could tell me how I can use the same variable on different tabs without getting a compile error I would appreciated that too)
Thanks
Keith