NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: terryd on January 20, 2012, 03:26:24 AM

Title: I can't change session values in my code
Post by: terryd 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]
Title: Re: I can't change session values in my code
Post by: Bruce 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'))
Title: Re: I can't change session values in my code
Post by: terryd 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.