LoopStep

Execute Iteration Step

Security Level 1 (Enabled)
SindByte tool execution flow: voice command, AI parse, execute, validate, result

Description

Executes a single iteration step of a loop previously initialized with LoopStart. Updates the iterator and the variables and returns the current status. Called repeatedly until the loop is complete.

JSON Parameters

{
  "loopId": "calc_001",
  "operations": [
    {"var": "sum", "op": "add", "value": "i"},
    {"var": "square", "op": "set", "value": "i^2"}
  ]
}
ParameterTypeRequiredDescription
loopIdStringYesThe loop identifier from LoopStart
operationsArrayNoOperations for this iteration
operations[].varStringYesTarget variable
operations[].opStringYesOperation: add, sub, mul, div, set
operations[].valueString/NumberYesValue or formula ("i" for the iterator)

Example Usage

API call:

POST /api/v1/tools/loopstep
Content-Type: application/json

{
  "loopId": "sum_calc",
  "operations": [
    {"var": "total", "op": "add", "value": "i"}
  ]
}

Examples

Simple sum step:

{
  "loopId": "sum_calc",
  "operations": [
    {"var": "total", "op": "add", "value": "i"}
  ]
}

Multiple operations:

{
  "loopId": "complex_calc",
  "operations": [
    {"var": "sum", "op": "add", "value": "i"},
    {"var": "sumSq", "op": "add", "value": "i^2"},
    {"var": "product", "op": "mul", "value": "i"}
  ]
}

Statistical calculation:

{
  "loopId": "stats_loop",
  "operations": [
    {"var": "count", "op": "add", "value": 1},
    {"var": "sumX", "op": "add", "value": "i"},
    {"var": "sumX2", "op": "add", "value": "i^2"}
  ]
}

Return Values

{
  "loopId": "calc_001",
  "status": "running",
  "current": 5,
  "remaining": 95,
  "variables": {
    "sum": 15,
    "square": 25
  },
  "completed": false,
  "success": true
}
FieldTypeDescription
loopIdStringThe loop identifier
statusStringCurrent status
currentNumberCurrent iterator value
remainingNumberRemaining iterations
variablesObjectCurrent variable values
completedBooleanTrue if the loop is complete
successBooleanTrue if successful

Related Tools

Why This Tool Stands Out

Perfect for:

Time Savings

No measured time-saving or performance figures are available here. Results depend on the task and environment.

Ready to Get Started?

Control your iterations step by step with LoopStep.

Download Now
Back to MathTools