0

Hi i don't have RedDot CMS and i want to know is it possible to use <!IoRangeList> inside <!IoRangePreExecute> also use ASP Classic to get sum of the elements inside for loop.

Or is the other way to do it

Here is my code

 <!IoRangePreExecute>   
 <%
 Dim a(5), b, c
 %>
 <% d = 0 %>
 <!IoRangeList>
   ' user range list as loop to get value from reddot
   a(<% d = d + 1 %>) = <%value%>
 <!/IoRangeList>     
 <% For Each b in a
    c = c + Cint(b)
    Next 
    Response.Write(c)
 %>
 <!/IoRangePreExecute>

Im wondering is the correct way to do it

Digital Legend
  • 149
  • 1
  • 13

2 Answers2

0

It would be easier to use the built in foreach loop tag, but yes you can do this that way(although the code in the rangelist isn't complete)

0

It is possible, but I would not recommend it. PreExecute is very inefficient, avoid if you can.

Prior to my recent departure from OpenText, I generally used iorangelist to output client-side code - perhaps as javascript data - and then used JS/JQuery to build a dynamic UI from this.

For your specific question, I would simply output the List loop as a client-side javascript:

<script>
var a = 0;

<%iorangelist%>
a += <%value%>;  //I'd check for numeric here.
<%/iorangelist%>

console.log(a);
</script>
Silas
  • 36
  • 5