next repeat instruction

Description

The next repeat instruction is used to stop the current pass of a repeat loop and start the next one immediately.

Syntax

Table 8.19. next repeat syntax

ProductionSyntaxLinks
next_repeat_instruction "next" "repeat" identifier ?

remarks:

  • if identifier is omitted then the innermost repeat loop is concerned in case of several nested repeat loops
  • if identifier is specified, then the repeat loop identified by identifier is concerned

the section called “next repeat instruction”

Examples

Example 8.22. next repeat example

The following code first creates some table data and then displays all row numbers containing at least one column whose value is void :

service instruction_examples

   command next_repeat_example_1
      script
      
         // create table data provider with 2 rows and 4 columns, and containing some simple test data
         const positive32 row_count = 2
         const positive32 column_count = 4
         const table_data_provider table_data_provider = fa_table_data_provider_for_tests.co_create ( &
         	i_row_count = c_row_count &
         	i_column_count = c_column_count )
         	
         // display all row numbers containing at least one void column

         repeat from row_index = 1 to c_row_count id: row_loop     // loop through all rows
            repeat from column_index = 1 to c_column_count         // loop through all columns
            
               const any_type cell_value = c_table_data_provider.co_cell_value ( &
                  i_row_index = v_row_index &
                  i_column_index = v_column_index )

               if c_cell_value =r void then
                  se_console.co_message ( "Row " & v_row_index.co_to_string & " contains at least one void column" )
                  next repeat row_loop
               end if

            end repeat
         end repeat
         
      end script
   end command
   
end service

See also