Hallo, João Miguel Pais hat gesagt: // João Miguel Pais wrote: > I have a patch where I wanted to get the data of the structures to write a > .txt file. the special question was about the symbol capabilities: how far > are symbols part of DS? I noticed that drawsymbol works, but I don't know > how to write a symbol to the structure (and there's no documentation yet). > is it possible already to store and retrieve symbols in DS, just like > floats? which version is necessary to have?
This should work since 0.39, but as always with data structures: This is an area that's changing a lot with every new Miller-Pd so I'd recommend to use 0.40 instead. With that, you can [set] and [get] symbol fields as shown in attached patch. Setting them on creation with [append] doesn't seem to work yet, however, at least I couldn't make it work. Ciao -- Frank Barknecht _ ______footils.org_ __goto10.org__
#N canvas 194 264 450 300 10; #N canvas 0 0 487 453 sym 0; #X obj 64 45 struct sym float x float y symbol s; #X obj 61 135 drawsymbol s; #X obj 255 262 pointer; #X msg 255 234 traverse pd-data-s \, bang; #X obj 162 198 t b b; #X msg 175 176 bang; #X obj 162 320 outlet; #X obj 162 152 inlet; #X obj 162 291 append sym x y; #X msg 162 238 100 100; #X connect 2 0 8 2; #X connect 3 0 2 0; #X connect 4 0 9 0; #X connect 4 1 3 0; #X connect 5 0 4 0; #X connect 7 0 4 0; #X connect 8 0 6 0; #X connect 9 0 8 0; #X restore 175 84 pd sym; #N canvas 0 0 450 300 data-s 0; #X restore 322 192 pd data-s; #X msg 61 10 bang; #X obj 175 138 pointer; #X msg 187 117 bang; #X symbolatom 61 164 10 0 0 0 - - -; #X obj 61 190 set -symbol sym s; #X symbolatom 200 217 10 0 0 0 - - -; #X obj 200 191 get sym s; #X obj 61 34 t b b; #X msg 61 91 symbol mysymbol; #X connect 0 0 3 0; #X connect 2 0 9 0; #X connect 3 0 6 1; #X connect 3 0 8 0; #X connect 4 0 3 0; #X connect 5 0 6 0; #X connect 8 0 7 0; #X connect 9 0 10 0; #X connect 9 1 0 0; #X connect 10 0 5 0;
_______________________________________________ [email protected] mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
