NetTalk Central

Author Topic: How long is a variable (not a session variable) valid?  (Read 2150 times)

patrick de laet

  • Newbie
  • *
  • Posts: 35
    • View Profile
    • ShopPlus
    • Email
How long is a variable (not a session variable) valid?
« on: February 09, 2014, 08:38:02 AM »
In a WebSource procedure, I assign some value to a v:PDL variable.
(not a SESSION variable, just an ordinary, short living variable).
After this, I include some HTML with the net:f include file directive and terminate my WebSource procedure.


p_web.SetValue('PDL', 'test')

 _('<!-- Net:f:/htm/navbar.htm -->')
 _('<!-- Net:f:/htm/logon.htm -->')

RETURN ! terminates my WebSource procedure

PS: the underscore is a home written procedure and just a shortcut for a Do SendPacket.
It keeps the html that I send to the browser clean and readable in my source code.

In my logon.htm I display the v.PDL variable as follows...

<!-- Net:v:PDL -->

It does display the correct contents of my PDL variable, but am I just lucky that my calling NetwebSource hasn't terminate in the meantime and my v:PDL variable is still valid?

Or remains my NetwebSource in memory until my complete page is send to the browser?

regards

Patrick De Laet


PS: the underscore procedure ...

_    Procedure(prmString)

  Code

    packet = clip(packet) & '<13,10>' & prmString

    Do SendPacket

!---
!---
!---
    Return



« Last Edit: February 09, 2014, 08:42:02 AM by patrick de laet »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: How long is a variable (not a session variable) valid?
« Reply #1 on: February 09, 2014, 09:45:38 PM »
The value is stored in the ValueQueue, which is bound to the single thread. So the value will remain as long as the thread is still going. In other words, it'll remain there until (just after) the response is completed.

cheers
Bruce