Hi,
Is there any way of looping through a for-loop backwards?
The subset is ordered by user, for example {1,4,3,5}. I want to loop backwards so from 5 to 3 to 4 to 1.
Hi,
Is there any way of looping through a for-loop backwards?
The subset is ordered by user, for example {1,4,3,5}. I want to loop backwards so from 5 to 3 to 4 to 1.
Best answer by Chris Kuip
Hi Mirthe,
Indeed, you cannot declare an indexed set to be a subset of another indexed set.
However, you can declare two indexed sets to be the subset of the same set. Once you have done that you can use the elements in the existing indexed set in the new indexed set; and also you can use the ordering of the existing indexed set in the new indexed set.
Enclosed find an adapted example of
In that example we constructed the indexed set:
Set s_let {
IndexDomain: i_rowno;
SubsetOf: s_alphabet;
OrderBy: user;
InitialData: data{};
}
To revert the data in s_let, we create a new set as follows: Set s_tel {
IndexDomain: i_rowno;
SubsetOf: s_alphabet;
OrderBy: -ord(i_let,s_let(i_rowno));
Definition: s_let(i_rowno);
}
Remarks:
With kind regards,
Chris
Already have an account? Login
Please use your business or academic e-mail address to register
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.