#N struct template2 float x float y float z float q float zz;
#N canvas 387 76 652 644 12;
#N canvas 595 403 493 354 stuff 0;
#X obj 241 225 pointer;
#X msg 76 71 bang;
#X obj 76 40 loadbang;
#X text 116 71 click here to re-initialize;
#X text 102 284 Explained later...;
#X obj 76 255 append template2 x y z q;
#X msg 332 143 \; pd-data2 clear;
#X msg 241 196 traverse pd-data2 \, bang;
#X obj 76 112 trigger bang bang bang, f 37;
#X msg 76 163 50 150 30 9 \, 200 90 -50 900 \, 100 100 -50 30, f 15
;
#X connect 0 0 5 4;
#X connect 1 0 8 0;
#X connect 2 0 1 0;
#X connect 7 0 0 0;
#X connect 8 0 9 0;
#X connect 8 1 7 0;
#X connect 8 2 6 0;
#X connect 9 0 5 0;
#X restore 505 358 pd stuff;
#X text 505 290 subpatches:;
#X obj 67 326 pointer;
#X msg 79 295 next;
#N canvas 1056 105 307 198 data2 1;
#X scalar template2 50 150 30 9 0 \;;
#X scalar template2 200 90 -50 900 0 \;;
#X scalar template2 100 100 -50 30 0 \;;
#X restore 505 313 pd data2;
#N canvas 442 234 453 133 template2 0;
#X text 38 87 The template for the two scalars \, as in the last patch
;
#X obj 40 54 filledpolygon 244 q 5 0 0 20 z 40 0;
#X obj 39 29 struct template2 float x float y float z float q;
#X restore 505 336 pd template2;
#X obj 67 408 get template2 x y z q;
#X floatatom 67 437 5 0 0 0 - - - 0;
#X floatatom 115 437 5 0 0 0 - - - 0;
#X floatatom 163 437 5 0 0 0 - - - 0;
#X floatatom 211 437 5 0 0 0 - - - 0;
#X msg 67 269 traverse pd-data2;
#X obj 113 373 print;
#X text 287 421 and outputs the values of x \, y \, z \, and q., f
22;
#X text 89 22 The simplest thing you can do with a collection of scalars
(a list) is to traverse it \, getting the numbers back out. This is
done using two objects \, "pointer" which does the traversal \, and
"get" which \, given a pointer to a scalar \, extracts numeric quantities
from it., f 60;
#X text 89 102 You can send the "pointer" object a "traverse" message
to point it to the head of the list. The argument "pd-data2" indicates
the Pd window named "data2." The head of the list means \, not the
first scalar in the list \, but the position before the first scalar
\, which is a valid pointer in Pd but has no data or template., f
60;
#X text 89 197 The "next" message tells the "pointer" object to go
to the next scalar in the list and output it. If there are no more
\, "pointer" outputs a bang at right.;
#X text 99 473 The "get" object takes a pointer \, checks that its
template agrees with what "get" is expecting \, i.e. \, "template2"
\, and if so outputs the values of x \, y \, z \, and q in the usual
reverse order., f 60;
#X text 99 536 The pointer sent from "pointer" to "get" is an elementary
Pd type on a level with "float" and "symbol".;
#X text 165 374 <= this gets a bang when we reach the end;
#X text 127 324 <= object that outputs pointers to scalars;
#X text 120 297 <= output next item (click 4 times);
#X text 200 268 <= go to head of list (click first);
#X text 224 406 <= this takes incoming pointers;
#X obj 113 352 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc
#000000 #000000;
#X text 398 600 updated for Pd version 0.32.;
#X connect 2 0 6 0;
#X connect 2 1 24 0;
#X connect 3 0 2 0;
#X connect 6 0 7 0;
#X connect 6 1 8 0;
#X connect 6 2 9 0;
#X connect 6 3 10 0;
#X connect 11 0 2 0;
#X connect 24 0 12 0;
