add struct

From DavinciWiki
Jump to: navigation, search


Description

Add an element to a structure. This function is shorthand for "object.name = value", but in this case, name can be a string variable.

Arguments and Return Values

The add_struct() function returns the value argument.

Usage

Syntax: add_struct(object = STRUCT, value = VAL, name = STRING)

Examples

 dv> z={}
 struct, 0 elements

 dv> y=1
 1

 dv> add_struct(z,y)
 1

 dv> z
 struct, 1 elements
     y: 1

 dv> add_struct(z,y*36.5,name='newelement')
 36.5

 dv> z
 struct, 2 elements
     y: 1
     newelement: 36.5

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left


Recent Core Changes

Modified On: 03-23-2006

Personal tools