get

get collection's item by given index


Parameters

get collection :complex :string :error :errorkind :date :binary :dictionary :object :store :block :range :bytecode
    index :any

Returns

  • :any

Examples

copy
user: #[ name: "John" surname: "Doe" ] print user\name ; John print get user 'surname ; Doe print user\surname ; Doe

copy
arr: ["zero" "one" "two"] print arr\1 ; one print get arr 2 ; two y: 2 print arr\[y] ; two

copy
str: "Hello world!" print str\0 ; H print get str 1 ; e z: 0 print str\[z+1] ; e print str\[0..4] ; Hello

copy
a: to :complex [1 2] print a\real ; 1.0 print a\image ; 2.0 print a\1 ; 2.0 ; available keys are: ; * 're and 'real ; * 'im, 'img and 'image ; ; available indexes: ; * 0..1

Related