PDA

View Full Version : scope of _session array?



HankFay
2015-03-26, 13:16
Hi,

I have an .rsp page running a JSON web service.

I am attempting to use the session array inside some prg's called from the .rsp page.

The names enumerate, but the values are not present, using this code (borrowed from the Wiki):

tcFile = psp_paramval(tcFile,"c:\temp\sessionvars.txt")
set textmerge to &tcFile
set textmerge delimiters to "{{","}}"
set textmerge on
foreach _session as name=>value
text
{{name}} -> {{etos(value}}
endtext
next
set textmerge off
set textmerge to


I am getting the name -> but not values, even though a memory dump before then shows the values as having been set. Thus my question about scope.

thanks,

Hank

PS: if it's supposed to work, I'll file a bug report, just let me know.

yvonne.milne
2015-03-26, 13:42
Hi Hank,

You seem to be missing the closing parenthesis for etos(value), or is that just in the posted code?

Regards,

Yvonne

HankFay
2015-03-26, 14:18
Hi Yvonne,

I wish it were only the posted code <s>. Interestingly, it did not throw a server error.

I'm relieved it's me (again).

thanks (again),

Hank