Redirected from Community/DekiCon/Sample 1: Control Flow Statements
0 of 1 found this page helpful

DekiCon Sample 1: Control Flow Statements

  • You do not have permissions to view this page - please try logging in.
Table of contents
  1. 1. Foreach Loop

This page shows how DekiScript statements can be used to compute values.

"Result";  
var x = 0; 
foreach(var y in [ 1, 2, 3, 4 ]) {
    if(y % 2 == 0) {
        let x += y;
    }
}
x;

Result 6

 

Foreach Loop

<ul>
    foreach(var x in page.files where string.endswith(x.name, '.gif')) {
        <li >
            x.name;
        </li>
    }
</ul>
  • ajax-loader.gif
  • favicon.gif


 

Was this page helpful?
Tag page

Files 3

FileVersionSizeModified 
You must login to post a comment.

Copyright © 2011 MindTouch, Inc. Powered by