What a funny/wired thing...

offonoll's picture

Hi! I am trying to build a list from 1 to X so I plugged a index variable to a queu and it doesn't respect to order. instead, the yellow box shows you a nice structure well orginzed. Does any body know why??

:)

PreviewAttachmentSize
number problem.qtz7.93 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

cwright's picture
Re: What a funny/wired thing...

you're using a queue in an iterator -- that's not going to do what you expect, because the Queue is stateful.

to build a structure from 1 to X, use javascript.

offonoll's picture
Re: What a funny/wired thing...

Oh! Thank you for your quick reply! Anyone has the js code?

cwright's picture
Re: What a funny/wired thing...

var result = new Object();
function (__structure list) main (__index start, __index stop, __boolean useArray)
{
   if(useArray)
   {
      result.list = new Array();
      for(var i = start; i <= stop; ++i)
         result.list[i] = i;
   }
   else
   {
      result.list = new Object();
      for(var i = start; i <= stop; ++i)
         result.list[i] = i;
   }
   return result;
}

offonoll's picture
Re: What a funny/wired thing...

Thank you!!! just a simple question: What is the difference between Queu 0:(0)= 0 1:(1)= 1 .... JS 0:"0"= 0 1:"1"= 1 ....

Is this important to understand something?

Thank you!!