Append a character to a set of numbers

Jul 5, 2007 at 4:36pm

Append a character to a set of numbers

In order to set the value of a jit.Cellblock to “X” or “O” I need to append the letter X to the set message that carries the x and y coordinates of the cell to be updated.

I can’t append a letter to the set of coordinates though…

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 288 298 26 9109513 print;
#P newex 288 268 46 9109513 append X;
#P message 288 237 50 9109513 set 1 4;
#P connect 1 0 2 0;
#P connect 0 0 1 0;
#P window clipboard copycount 3;

Any ideas?

#32768
Jul 5, 2007 at 6:37pm

#108359
Jul 5, 2007 at 7:49pm

sprintf would be useful here. You could also use append and prepend.

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 129 162 97 196617 sprintf set %i %i X;
#P newex 129 194 40 196617 print;
#P message 129 110 23 196617 1 4;
#P newex 35 162 62 196617 prepend set;
#P newex 35 194 40 196617 print;
#P newex 35 141 49 196617 append X;
#P message 35 110 23 196617 1 4;
#P connect 6 0 5 0;
#P connect 4 0 6 0;
#P connect 0 0 1 0;
#P connect 1 0 3 0;
#P connect 3 0 2 0;
#P window clipboard copycount 7;


Chris Muir | “There are many futures and only one status quo.
cbm@well.com | This is why conservatives mostly agree,
http://www.xfade.com | and radicals always argue.” – Brian Eno

#108360

You must be logged in to reply to this topic.