O'Reilly logo

Tcl/Tk in a Nutshell by Paul Raines, Jeff Tranter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

vector

vector operation [arg arg...]

Create and manipulate vectors, that is, ordered sets of real numbers. BLT's vectors are mor e ef ficient than standard Tcl lists and arrays for accessing and manipulating large sets of real numbers. The following operations are defined:

vector vecSpec [vecSpec...] [option value...]

Same as vector create.

vector create [vecSpec...] [option value...]

Create one or more new vectors according to vecSpec and the following options. The name of the last vector created is Returned. The vecSpec argument specifies the vector's name and size according to these valid forms:

vecName

A vector named vecName with no components.

vecName (size)

A vector named vecName with size components, all initialized to 0.0 and with the index starting from 0.

vecName (first:last)

A vector named vecName with components indexed from first to last, inclusive, all initialized to 0.0.

The following options are available to the create operation:

-variable varName

Name of a Tcl array to be associated with the vector. By default, the variable is the same as the vector name (this may change in a future release of BLT). Any existing array by this name is deleted. If varName is an empty string, then no variable will be mapped. See the "Accessing Vectors as Arrays" section for how this array variable can be used.

-command cmdName

Name of a Tcl command to be mapped to the vector. A Tcl command by that name cannot already exist. If the command name is the empty string, then no command will be mapped ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required