*rangeadd()

Add a number to a list so that ranges can be found with @rangecount(), @rangestart(), and @rangeadd().

Syntax

*rangeadd (number)

Type

HyperMesh Template Command

Inputs

number
The integer number to add to the list.

Example

*elements(104,0,"","")
  *format()
    *rangeadd(id)
  *after()
    *counterset(counter1,1)
    *loopif([counter1 <= @rangecount()])
      *string("start of range = ")
      *field(integer,[@rangestart(counter1)],0)
      *end()
      *field(integer,[@rangeend(counter1)],0)
      *end()
      *counterinc(counter1)
    *endloop()
    *rangereset()
*output()

Use *rangeadd() to add numbers to a list. Once all numbers have been added, @rangecount() returns the number of ranges (for example 1-5, 10-20) that are in the list. Use the functions @rangestart() and @rangeend() to get the actual ranges.