View Single Post
Old 10-20-2013, 04:46 AM   #54
chilledpanda
Human being with feelings
 
chilledpanda's Avatar
 
Join Date: Jan 2013
Location: United Kingdom
Posts: 28
Default

Here's a technique I found useful for debugging, by watching local memory akin to memory watch widows in professional debuggers.

First set up a slider (I use 64 as it's he last one),
This slider allows you to view local 0-to 2048,

slider64:0<0,2048,16>MEMWATCH LOC

Then change/add @slider to read the slider and set the memwatchvariable

@slider
//debugging code
memwatch = floor(slider64);


Add the follow to the @gfx uppdate block this constantly updates so allows us to constantly update the mem watch variables

@gfx

//debug code
memwatch_00 = memwatch[0];
memwatch_01 = memwatch[1];
memwatch_02 = memwatch[2];
memwatch_03 = memwatch[3];
memwatch_04 = memwatch[4];
memwatch_05 = memwatch[5];
memwatch_06 = memwatch[6];
memwatch_07 = memwatch[7];
memwatch_08 = memwatch[8];
memwatch_09 = memwatch[9];
memwatch_10 = memwatch[10];
memwatch_11 = memwatch[11];
memwatch_12 = memwatch[12];
memwatch_13 = memwatch[13];
memwatch_14 = memwatch[14];
memwatch_15 = memwatch[15];



Then in the JS development environment editor make sure the auto refresh is ticked under the left window and then locate the memwatch variables.

Move the slider and see the memory locations update in steps of 16 values.
__________________
-------------------------------------------------------------------------------
http://soundcloud.com/chilled-panda
chilledpanda is offline   Reply With Quote