This page has been translated automatically.
Программирование
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
CIGI Client Plugin
Rendering-Related Classes
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

For

A very flexible loop construct in UnigineScript. The for loop is executed as long as the condition stays true, but it will not be executed at all if the condition initially is false.

Syntax

Source code (UnigineScript)
for(initial_instruction; loop_condition; loop_increment) { 
	// some_code; 
}

Parts

  • initial_instruction is executed before the first loop iteration starts.
  • loop_condition is checked before each (including the first) loop iteration.
  • loop_increment is executed at the end of each iteration.

Example

Source code (UnigineScript)
for(int i = 0, j = 10; i < 10 && j > 0; i++, j -= 2) {
	log.message("%d ",i);
}

// the result is: 0 1 2 3 4
Last update: 21.12.2017
Build: ()