make_list(length, initial_value, capacity=length)

Create a new list of length "length" with the initial value of each element given by "initial_value" and assign it to a variable.

The "initial_value" sets the type of the list. It can be a complex type like struct. If not provided, the "capacity" will be defaulted to "length".

Creation list of list with this function is not supported (they are matrices in URScript).

Parameters

length: Number of elements which will be initialized

initial_value: Initial value of the elements

capacity: Maximum number of elements. List can be extended and contracted between 0, and capacity (Optional default value equals to length)

Example command 1: list_1 = make_list(5, "a")

Equivalent to ["a", "a", "a", "a", "a"]

  • Example Parameters:
    • length = 5
    • initial_value = "a"
    • capacity = 5

Example command 2: list_2 = make_list(10, 0, 100)

  • Example Parameters:
    • length = 10
    • initial_value = 0
    • capacity = 100

Example command 3: list_3 = make_list(0, 0, 100)

Create an initially empty list with the potential to hold 100 elements of integers.

  • Example Parameters:
    • length = 0
    • initial_value = 0
    • capacity = 100