NetTalk Central

Author Topic: I can't change session values in my code  (Read 2587 times)

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
I can't change session values in my code
« on: January 20, 2012, 03:26:24 AM »
Windows7Ultimate64 bit Clarion 6.3_9056 NT545
NettalkCode.txt is a snippet of my code.
In it the lines:
    CASE p_web.GSV('APP:Gender')
    OF 'Male'
        p_web.SSV('APP:Sex',0)
    ELSE
        p_web.SSV('APP:Sex',1)
    END
    CASE p_web.GSV('APP:Smoker')
    OF 'Yes'
        p_web.SSV('APP:SmokerIndicator',1)
    ELSE
        p_web.SSV('APP:SmokerIndicator',0)
    END
are intended to set the APP:Sex and APP:SmokerIndicator session variables which are then used as parameters to a calculate function
The calculate.txt file as a dbgview log file
From the log file the value of APP:gender is 'Female' therefore I would expect the value of APP:Sex to be 1
The value Of APP:Smoker is Yes and I would therefore expect the value of SmokerIndicator to be 1
This isn't the case.
I would appreciate anyone showing what I am doing incorrectly.

Thanks

[attachment deleted by admin]
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: I can't change session values in my code
« Reply #1 on: January 20, 2012, 05:47:12 AM »
put a Trace call at the two places where you do an EXIT.

oh, and change
p_web._trace('APP:Sex ' & APP:Sex & ' APP:SmokerIndicator ' & APP:SmokerIndicator)
to
p_web._trace('APP:Sex ' & p_web.GSV('APP:Sex') & ' APP:SmokerIndicator ' & p_web.GSV('APP:SmokerIndicator'))

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: I can't change session values in my code
« Reply #2 on: January 20, 2012, 07:12:40 AM »
Yup That was it. Can't see the wood for the trees.
The exits weren't affecting the situation.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186