REAPER KB

Accessing scalar components of coordinate_list/expressions

walter_themes/walter-scalar-section-accessing-scalar-components-of-coordinate-list-expressions · kind=reference

Accessing scalar components of coordinate_list/expressions

A coordinate_list is composed of 8 scalar values, as described above.

Kind: concept

A coordinate_list is composed of 8 scalar values, as described above. To convert from a named coordinate_list to a scalar value, you can use the following syntax:

   set tmp [1 2 3 4 5 6 7 8]
   tmp{x} or tmp{0}  -- first item in coordinate_list (1)
   tmp{y} or tmp{1}
   tmp{w} or tmp{2}
   tmp{h} or tmp{3}
   tmp{ls} or tmp{4}
   tmp{ts} or tmp{5}
   tmp{rs} or tmp{6}
   tmp{bs} or tmp{7}  -- last item in coordinate_list (8)

So, in the above example, you can specify "tmp{y}" anywhere you would otherwise use "2". For example, instead of

  set foo w>2 [1] [0 1 2 3 4 5 6 7]

you could specify

  set foo w>tmp{y} [1] [0 1 tmp{y} 3 4 5 6 7]

Note: in the context of using coordinate_list names inside of [] coordinate_list, if the {} index is omitted, the current index will be used, i.e. the following are the same:

  set tmp [1 2 3 4]
  set foo [0 0 tmp tmp]
    and
  set foo [0 0 tmp{2} tmp{3}]

Other sections in this document