xData.Loop..EndLoop
Top  Previous  Next


Extra Data.Loop..EndLoop statements with corresponding extra data sections

Before reading any further you should understand the Data.Loop..EndLoop statement.

The xData.Loop..EndLoop statement is what it sounds like - an extra Data.Loop..EndLoop statement with a corresponding extra data section. This is a much more flexible solution than Data.Loop..EndLoop and [Data] - there can be any number of [xData] sections and subsequently multiple xData.Loop..EndLoop statement that furthermore can be nested. It is also possible to nest a Data.Loop..EndLoop with xData.Loop..EndLoop.

Each [xData] section must start with an [xData_name_Begin] tag and end with an [xData_name_End] tag. The name must be unique for each section and can not contain numbers.

Commands enclosed in the xData.Loop..EndLoop structure can access any column on the current [xData] section row through variable names combined by the section name and the column number. For example to access the second column in an [xData] section named myitems, use %myitems2%.

[xData] sections uses the same settings as the [Data] section for data delimiter - BatchSettings.Delimiter and marker column - BatchSettings.MarkerCol, in other words: all sections containing data in a script will use the same delimiter between columns and will have the same column reserved for markers.

Please notice that most commands support the [Data] section only - the [Data] section must in most cases still be used as the main data source in a script. Use xData.Loop..EndLoop and [xData] when there is a need to do things above the normal.

It is possible to copy data between [xData] and [Data] or different [xData] sections by using save and load commands - example save xData with xData.Save and load into [Data] with Data.Load.

Category
Data section

Script sections
All

xData.Loop xDataSectionName
.
.
EndLoop

xDataSectionName
Name of [xData] section to loop  

Example
Combine text from two [xData] sections named "x" and "y" and write the result to the log window

[Settings_Begin]
BatchSettings.Delimiter=,
BatchSettings.MarkerCol=2
[Settings_End]

[Batch_Begin]
xData.Loop x   
 xData.Loop y   
  LogWindow.Write %x1% %y1%   
 xData.EndLoop   
xData.EndLoop   
[Batch_End]

[xData_x_Begin]
Hello
Goodbye
[xData_x_End]

[xData_y_Begin]
Steve
Lisa
Ann
[xData_y_End]




Full examples
·Find and replace multiple Linux user attribute values at once  
·Find and replace multiple NetWare user attribute values at once  
·Find and replace multiple Windows user attribute values at once