Skip to main content
14-Alexandrite
July 10, 2023
Solved

using while loop with break/continue statement

  • July 10, 2023
  • 1 reply
  • 1734 views

Dear all,

 

I have a column of values stored in the variable "i". My intent is, I want to utilize a while loop with a continue/break statement to track a specific range of numbers within the column based on a given input row index. For instance, if I input the row-index value of "4", I would like to extract the range of values from the 4th index of variable "i" until the end.

fahmed2_0-1688955429477.png

 

 

Please help.

 

Thank you

 

Best answer by Werner_E

Thats what the stack() function is made for!

 

new:=stack(i,j)

 

1 reply

25-Diamond I
July 10, 2023

This is what the submatrix() function is made for - look it up in the help.

 

Your example:  submatrix(i, 4, last(i), 0, 0)

 

fahmed-214-AlexandriteAuthor
14-Alexandrite
July 10, 2023

Thabk you for your reply. I intent to use the while loop with break/continue statement because I want each extracted value to be assigned on a separate variable and show the new variable as a range

25-Diamond I
July 10, 2023

@fahmed-2 wrote:

Thabk you for your reply. I intent to use the while loop with break/continue statement because I want each extracted value to be assigned on a separate variable and show the new variable as a range


??????

You would have to give one or better a couple of examples which show what you are looking for.

Show for each example the input values (vector and limit index) and also the data structure you want as a result.

 

You shure would have a hard time to assign each value from 5 to 100 (your given example) to a separate variable and you sure can*t use it as a Prime range variable!