components/blockly-src/blocks/loops.js
function() {
    this.jsonInit({
      "message0": Blockly.Msg.CONTROLS_FOR_TITLE,
      "args0": [
        {
          "type": "field_variable",
          "name": "VAR",
          "variable": null
        },
        {
          "type": "input_value",
          "name": "FROM",
          "check": "Number",
          "align": "RIGHT"
        },
        {
          "type": "input_value",
          "name": "TO",
          "check": "Number",
          "align": "RIGHT"
        },
        {
          "type": "input_value",
          "name": "BY",
          "check": "Number",
          "align": "RIGHT"
        }
      ],
      "inputsInline": true,
      "previousStatement": null,
      "nextStatement": null,
      "colour": Blockly.Blocks.loops.HUE,
      "helpUrl": Blockly.Msg.CONTROLS_FOR_HELPURL
    });
    this.appendStatementInput('DO')
        .appendField(Blockly.Msg.CONTROLS_FOR_INPUT_DO);
    // Assign 'this' to a variable for use in the tooltip closure below.
    var thisBlock = this;
    this.setTooltip(function() {
      return Blockly.Msg.CONTROLS_FOR_TOOLTIP.replace('%1',
          thisBlock.getFieldValue('VAR'));
    });
  }
function() {
    this.jsonInit({
      "message0": Blockly.Msg.CONTROLS_FOR_TITLE,
      "args0": [
        {
          "type": "field_variable",
          "name": "VAR",
          "variable": null
        },
        {
          "type": "input_value",
          "name": "FROM",
          "check": "Number",
          "align": "RIGHT"
        },
        {
          "type": "input_value",
          "name": "TO",
          "check": "Number",
          "align": "RIGHT"
        },
        {
          "type": "input_value",
          "name": "BY",
          "check": "Number",
          "align": "RIGHT"
        }
      ],
      "inputsInline": true,
      "previousStatement": null,
      "nextStatement": null,
      "colour": Blockly.Blocks.loops.HUE,
      "helpUrl": Blockly.Msg.CONTROLS_FOR_HELPURL
    });
    this.appendStatementInput('DO')
        .appendField(Blockly.Msg.CONTROLS_FOR_INPUT_DO);
    // Assign 'this' to a variable for use in the tooltip closure below.
    var thisBlock = this;
    this.setTooltip(function() {
      return Blockly.Msg.CONTROLS_FOR_TOOLTIP.replace('%1',
          thisBlock.getFieldValue('VAR'));
    });
  }
function ( ) { this . jsonInit ( { "message0" : Blockly . Msg . CONTROLS_FOR_TITLE , "args0" : [ { "type" : "field_variable" , "name" : "VAR" , "variable" : null } , { "type" : "input_value" , "name" : "FROM" , "check" : "Number" , "align" : "RIGHT" } , { "type" : "input_value" , "name" : "TO" , "check" : "Number" , "align" : "RIGHT" } , { "type" : "input_value" , "name" : "BY" , "check" : "Number" , "align" : "RIGHT" } ] , "inputsInline" : true , "previousStatement" : null , "nextStatement" : null , "colour" : Blockly . Blocks . loops . HUE , "helpUrl" : Blockly . Msg . CONTROLS_FOR_HELPURL } ) ; this . appendStatementInput ( 'DO' ) . appendField ( Blockly . Msg . CONTROLS_FOR_INPUT_DO ) ; // Assign 'this' to a variable for use in the tooltip closure below. var thisBlock = this ; this . setTooltip ( function ( ) { return Blockly . Msg . CONTROLS_FOR_TOOLTIP . replace ( '%1' , thisBlock . getFieldValue ( 'VAR' ) ) ; } ) ; }
Block for 'for' loop.
@this Blockly.Block
Block for for loop .