about_For.help

about_For.help - TOPIC about_For SHORT DESCRIPTION...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 TOPIC about_For SHORT DESCRIPTION Describes a language command you can use to run statements based on a conditional test. LONG DESCRIPTION The For statement (also known as a For loop) is a language construct you can use to create a loop that runs commands in a command block while a specified condition evaluates to true. A typical use of the For loop is to iterate an array of values and to operate on a subset of these values. In most cases, if you want to iterate all the values in an array, consider using a Foreach statement. Syntax The following shows the For statement syntax. for (<init> <condition> {<statement list>} The <init> placeholder represents one or more commands, separated by commas, that are run before the loop begins. You typically use the <init> portion of the statement to create and initialize a variable with a starting value. This variable will then be the basis for the condition to be tested in the next portion of the For statement. The <condition> placeholder represents the portion of the For statement that resolves to a true or false Boolean value. Windows PowerShell
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

about_For.help - TOPIC about_For SHORT DESCRIPTION...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online