Initializing help system before first use

getindexsetelements

getindexsetelements


Purpose
Copy the elements from an index set of a specified array into a list of basicvalue
Synopsis
function xreflect~getindexsetelements(entityname:string,setnum:integer):list of xreflect~basicvalue
procedure xreflect~copyindexsetelements(entityname:string,setnum:integer,destlist:list of xreflect~basicvalue)
Arguments
entityname 
The name of the public array entity to access
setnum 
Which index set to access (1 being the first)
destlist 
The list into which to copy the entities
Return value
A newly-created list containing each value from the specified index set, in basicvalue types
Example
The following:
public declarations
  myvar: array(1..3,4..5) of string,
end-declarations
writeln('myvar=',getindexsetelements('myvar',1))
produces this output:
myvar=[1,2,3]
Further information
1. copyindexsetelements is similar to getindexsetelements, but copies the values into an existing list rather than returning a new one.
2. If the specified entity name cannot be found, the model will terminate with a runtime error.
3. If the specified entity is not an array, the model will terminate with a runtime error.
4. If the requested index set is not of a supported type, the model will terminate with a runtime error.
Related topics