NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Johan de Klerk on August 20, 2026, 03:14:56 AM
-
Hi,
I need to set some p_web.SSV('xx',YY) variables when the Web Server starts.
It must/need run this once and not on any subsequent requests.
The p_web.GSV('xx') will be used in various browses and forms.
It will be treated as some global variables.
I looked and put a lot or Trace statements in various embeds but all of them runs every time some fields, buttons, option or variable is clicked.
Any help would be appreciated.
Regards
Johan de Klerk
-
What are you trying to do, Johan?
A session value is going to be tied to a particular session ID, so it will only be "global" for that one session.
I use a number of regular global variables in web apps that are set at startup and then read-only thereafter.
If you don't want to use global variables, you can set host values in the web server procedure when it starts (maybe in ThisWindow.init). (Since pweb does not exist in the web server, you would use s_web.SetHostValue).
-
Hi Johan,
Again, I ask the same question that Jane asked. What are you trying to do?
I am doing some file upload and manipulation and then save. The code runs several times but I only wanted it to run ONCE. So, I looked at the stage number for the stuff I wanted to do and found that it would run only ONCE if I limited it to a certain stage - there are equates for the stage numbers in a form. So, looking at the stage number when your code fires might help you limit it to only a certain stage.
Ron
-
Johan,
BTW, the procedures are STATELESS - that means that they do not stay open until closed. The NT code keeps cycling through the procedure and keeps track of the stage it was in when NT engine last went though it. So, the code keeps cycling through the form until the user closes it with some action. SO, watch the stage in a trace as your app runs and you will see it cycling through stages. There is even a check box on forms to write the stage to the trace.
Ron
-
Hi Jane,
Your advice for SetHostValue and GetHostValue works perfect.
Thank you very much.
Regards
Johan de Klerk
-
Hi Ron,
Thanks for you reply.
Your suggestion has helped me sort out another problem in another part of the system I have been battling with.
Regards
Johan de Klerk