Today I got the question: Get elements of a set using set name as a string?
This can be achieved using a runtime library.
The interface to the data is a procedure with:
- input : the set name
- outputs :
o an integer set with the same number of elements
o a string parameter indexed over that integer set with the names of the elements as strings.
The tricky part of creating the runtime library is the passing of arguments.
Arguments are local identifiers in a procedure, and local identifiers cannot be directly created
using model editing procedures.
This is circumvented by first creating the declaration section, and
then moving that declaration section as a section inside the procedure.
An example project which does just that is enclosed.