Facility Control

 View Only
  • 1.  For..Next loops

    Posted 02-09-2017 05:50
    How do you perform a for/next loop in OG script?

    The Javascript format doesn't seem to work....

    for (x = 0 ; x < 64; x++){
    ...
    }



  • 2.  RE: For..Next loops

    Posted 02-09-2017 17:26
    You need to declare the variable x somewhere. This should work:

    for (var x = 0 ; x < 64; x++){
    ...
    }
    #DashBoard


  • 3.  RE: For..Next loops

    Posted 02-10-2017 12:06

    You shouldn't have to declare x with var.. I've used the js syntax numerous times.

    for (i = 0; i < 10; i++) {
     ogscript.debug('This is number ' + i);
    };

    Keep in mind that you can only use the "normal" booleans ( ) when editing in the ogscript editor of a task. If you edit directly in sourcecode you have to use < or >


    #DashBoard