NetTalk Central

Author Topic: Pass a Session Variable as a parameter?  (Read 40 times)

JohanR

  • Sr. Member
  • ****
  • Posts: 406
    • View Profile
    • Email
Pass a Session Variable as a parameter?
« on: Today at 04:33:26 AM »
Hi,

Sure I know this but it's buried in the year end brain fog of too much screen time and not enough down time....
Think I might even have asked this somewhere, sometime, but cannot find the answer. :)


How to pass a session variable to a function.

As I understand session variables are stringtheory objects, so if I have a function like
MyFunction(stringtheory tmpstr)

How do I pass a session variable into that function without using intermediary strings



thanks


Johan








JohanR

  • Sr. Member
  • ****
  • Posts: 406
    • View Profile
    • Email
Re: Pass a Session Variable as a parameter?
« Reply #1 on: Today at 04:47:44 AM »
Hi,

Sorry had to add, this is how I am doing currently.

my_tmp_st  stringtheory

     MyFunction(my_tmp_st)
     p_web.SSV('session_var',my_tmp_st.GetValue())


Johan




Jane

  • Sr. Member
  • ****
  • Posts: 419
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: Pass a Session Variable as a parameter?
« Reply #2 on: Today at 08:02:24 AM »
Pass the p_web object as one of your parameters.

Here's a prototype example from one of my procedures where p_web is the first of two parameters I'm passing.

Code: [Select]
(NetWebServerWorker p_web,LDAPParametersGroupType pParms)

JohanR

  • Sr. Member
  • ****
  • Posts: 406
    • View Profile
    • Email
Re: Pass a Session Variable as a parameter?
« Reply #3 on: Today at 08:20:43 AM »

Hi Jane

Thanks , I do pass p_web into other functions and have that working when it's functions that work with p_web and session variables,
but in this case it's a function that only receives a stringtheory object and then populates the data.

It's unaware of which specific session variable to load or unaware that it's a NTWS

I have it working with a temp stringtheory object, was just looking at it and thinking there was a way to reference the session variable as a stringtheory obect and then pass that in.


thanks

Johan