#N struct template5a float x float y symbol sym;
#N struct template5b float x float y text bla;
#N canvas 343 38 631 656 12;
#N canvas 972 38 304 326 data5 1;
#X scalar template5a 50 50 banana \;;
#X scalar template5a 150 120 banana \;;
#X scalar template5b 50 220 \; \;;
#X restore 538 401 pd data5;
#X symbolatom 67 358 10 0 0 0 - - - 0;
#X msg 75 327 symbol apple;
#X text 61 275 set symbol:;
#X obj 67 389 set -symbol template5a sym;
#N canvas 347 126 508 418 template5a 0;
#X text 212 191 The instruction is to draw the "sym" variable in the 20/25 coordinates., f 36;
#X obj 56 198 drawsymbol sym 20 25;
#X obj 61 82 struct template5a float x float y symbol sym;
#X obj 89 341 drawpolygon 0 10 0 0 105 0 105 55 0 55 0 0;
#X text 67 35 Besides the usual x/y fields we now have a symbol field named "sym"., f 35;
#X text 55 152 We now use the [drawsymbol] object \, which is actually the same as [dranumber]., f 41;
#X text 97 298 We also have a [drawpolygon] that draws a frame around the symbol., f 34;
#X text 51 241 Unlike floats fields \, you can't edit symbol values by click and typing directly on them.;
#X restore 503 355 pd template5a;
#N canvas 357 56 556 436 stuff 0;
#X obj 354 204 pointer;
#X msg 354 174 traverse pd-data5 \, bang;
#X obj 210 237 append template5a x y;
#X msg 243 333 symbol banana;
#X obj 243 374 set -symbol template5a sym;
#X obj 243 300 trigger bang pointer;
#X msg 210 186 50 50 \, 150 120;
#X obj 66 292 append template5b x y;
#X obj 148 121 trigger bang bang bang bang;
#X msg 376 117 \; pd-data5 clear;
#X obj 168 63 loadbang;
#X msg 66 255 50 220;
#X obj 66 336 s text-pointer;
#X obj 148 28 inlet;
#X text 71 362 send pointer to [text set], f 13;
#X text 255 274 initialize symbol value;
#X obj 168 89 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
#X connect 0 0 2 2;
#X connect 1 0 0 0;
#X connect 2 0 5 0;
#X connect 2 0 7 2;
#X connect 3 0 4 0;
#X connect 5 0 3 0;
#X connect 5 1 4 1;
#X connect 6 0 2 0;
#X connect 7 0 12 0;
#X connect 8 0 11 0;
#X connect 8 1 6 0;
#X connect 8 2 1 0;
#X connect 8 3 9 0;
#X connect 10 0 16 0;
#X connect 11 0 7 0;
#X connect 13 0 8 0;
#X connect 16 0 8 0;
#X restore 302 447 pd stuff;
#X msg 246 272 traverse pd-data5 \, next;
#X listbox 424 551 15 0 0 0 - - - 0;
#X obj 424 522 get template5a sym;
#X msg 326 304 send get;
#X obj 424 494 r get;
#N canvas 440 166 440 359 template5b 0;
#X obj 66 69 struct template5b float x float y text bla;
#X obj 41 192 drawtext bla 10 10;
#X text 78 18 Besides the usual x/y fields we now have a text field named "bla"., f 35;
#X text 45 112 The [drawtext] is again just another alias for [drawnumber]/[drawsymbol] and has a drawing instruction for it., f 46;
#X text 180 184 draw the "bla" text variable in the 10/10 coordinates., f 28;
#X obj 72 280 drawpolygon 600 5 0 0 160 0 160 60 0 60 0 0;
#X text 102 235 We also have a [drawpolygon] to draw a frame around the text., f 32;
#X restore 503 378 pd template5b;
#X obj 61 449 vradio 19 1 0 3 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0;
#X floatatom 61 515 3 0 0 0 - - - 0;
#X msg 117 508 1 2 3 4 a b c d e;
#X msg 131 535 list a b c d e f g h i j;
#X msg 97 482 symbol text;
#X floatatom 148 563 5 0 0 0 - - - 0;
#X msg 67 300 symbol orange;
#X obj 276 578 r text-pointer;
#X obj 97 609 text set -s template5b bla;
#X msg 197 300 next;
#X text 396 304 <-- send pointer to "get".;
#X text 102 458 set text:;
#X text 327 417 <-- recreate;
#X obj 302 418 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
#X text 144 358 <-- type;
#X obj 246 355 pointer template5a;
#X text 22 459 set line, f 4;
#X obj 246 234 bng 25 250 50 0 empty empty <--\ click\ here\ first 32 13 0 14 #dfdfdf #000000 #000000;
#X text 371 448 <-- open to see how it works.;
#X obj 197 271 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
#X text 20 11 Besides floats \, scalars can have other data types \, namely: symbols \, text and arrays. This example shows how to deal with symbols and text. A text can have many lines with lists of one or more elements (symbols and/or floats)., f 82;
#X text 20 154 We now have two separate templates mixed in the same collection on [pd data5]. See that [pointer] can have an argument to specify a particular template \, we use it to traverse the two scalars containing symbols. Another feature of [pointer] here is to use the "send" message to send the pointer to a [get] object., f 82;
#X text 472 493 get pointer;
#X text 20 60 Unlike float fields \, that you can set when adding an item with [append] \, you can only use the [set] object to set symbol values and the [text set] object to set texts. When setting a symbol with [set] \, you need the "-symbol" flag and you can't set floats and symbols with the same [set] object. For [text] \, you need to use the "-s" flag to deal with Data Structures. Check also the help file of [text] to see how to use [text get] to get values from text fields., f 82;
#X connect 1 0 4 0;
#X connect 2 0 1 0;
#X connect 7 0 28 0;
#X connect 9 0 8 0;
#X connect 10 0 28 0;
#X connect 11 0 9 0;
#X connect 13 0 14 0;
#X connect 14 0 21 1;
#X connect 15 0 21 0;
#X connect 16 0 21 0;
#X connect 17 0 21 0;
#X connect 18 0 21 0;
#X connect 19 0 1 0;
#X connect 20 0 21 3;
#X connect 22 0 28 0;
#X connect 26 0 6 0;
#X connect 28 0 4 1;
#X connect 28 2 7 0;
#X connect 30 0 7 0;
#X connect 32 0 22 0;
