Zeynep

Zeynep

  • NA
  • 9
  • 658

Go to Statements

Mar 3 2022 7:08 AM

How should I use goto statement if I use if & for statements? Code seems like as below.

 

private void ... (object sender, RoutedEventArgs e) // a buttons click event

{

if(a condition)

{

... Adding DataSet Table command
... Open & Select txt file command
...
...

 if (stallclick >0)

  {

   goto Analysis;

  }

...
...
...
...
 if(an other condition )

  {

   ...... some code lines which is about the selected txt file as file name items coordinate system data(xyz) and save this data an ARRAY list

   Analysis:

   for( loop )

   {

          ...... some code lines which took data above and can not be a function of something
          ...... 
          ...... if-for statements

   }

  }

 }

} 

Answers (3)