#N struct template2 float x float y float z float q float zz;
#N canvas 362 87 652 624 12;
#X text 401 580 updated for Pd version 0.32.;
#N canvas 454 366 566 337 stuff 0;
#X obj 322 191 pointer;
#X msg 85 64 bang;
#X obj 85 33 loadbang;
#X text 125 64 click here to re-initialize;
#X text 183 257 Explained later...;
#X obj 157 228 append template2 x y z q;
#X msg 321 103 \; pd-data2 clear;
#X msg 322 169 traverse pd-data2 \, bang;
#X msg 85 176 50 150 30 9 \, 200 100 -20 900 \, 100 100 -50 30, f
29;
#X obj 85 105 trigger bang bang bang;
#X connect 0 0 5 4;
#X connect 1 0 9 0;
#X connect 2 0 1 0;
#X connect 7 0 0 0;
#X connect 8 0 5 0;
#X connect 9 0 8 0;
#X connect 9 1 7 0;
#X connect 9 2 6 0;
#X restore 505 358 pd stuff;
#X text 505 290 subpatches:;
#X obj 67 326 pointer;
#X msg 79 294 next;
#N canvas 1056 105 307 198 data2 1;
#X scalar template2 50 150 30 9 0 \;;
#X scalar template2 200 100 -20 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 378 get template2 x y z q;
#X floatatom 67 407 5 0 0 0 - - -;
#X floatatom 115 407 5 0 0 0 - - -;
#X floatatom 163 407 5 0 0 0 - - -;
#X floatatom 211 407 5 0 0 0 - - -;
#X msg 67 269 traverse pd-data2;
#X obj 113 353 print;
#X text 287 391 and outputs the values of x \, y \, z \, and q., f
22;
#X text 79 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 79 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 79 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 453 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 516 The pointer sent from "pointer" to "get" is an elementary
Pd type on a level with "float" and "symbol".;
#X text 165 354 <= this gets a bang when we reach the end;
#X text 127 324 <= object that outputs pointers to scalars;
#X text 120 296 <= output next item (click 4 times);
#X text 200 268 <= go to head of list (click first);
#X text 224 376 <= this takes incoming pointers;
#X connect 3 0 7 0;
#X connect 3 1 13 0;
#X connect 4 0 3 0;
#X connect 7 0 8 0;
#X connect 7 1 9 0;
#X connect 7 2 10 0;
#X connect 7 3 11 0;
#X connect 12 0 3 0;
