Question
Patrik Spisak · Apr 6, 2020

Loop over %session.object in CSP Application

HI,

 

I have sample %session like this

 

%session.Data("product", "1") = "Product 1"

%session.Data("product", "2") = "Product 2"

%session.Data("product", "3") = "Product 3"

%session.Data("product", "4") = "Product 4"

%session.Data("product", "5") = "Product 5"

How can i loop in tag based CSP application over %session?

if i have <csp:while condtion="">  Is there something like %session.Data("products").Next() ?

00
1 0 1 124
Log in or sign up to continue

Replies

you have to mimic %Next() as %session.Data is a Multidimensional Array)

set pos=-1
while pos { set pos=$order(%session.Data("product",pos),1,value) /* whatever */ }