cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • DownloadSemiconductor Toolkit: Tools to create wafer maps, add wafer geometry to graphics, explore die defects & compare wafers.
  • Discovery Summit 2026: Early User Edition - September 23-24.Register. It's free.
  • Use JMP Clinical with CDISC-compliant data. Review studies, ID safety and efficacy signals & communicate findings with interactive graphics. Register to see how. Aug. 27, 2 pm US ET.

Uncharted

Choose Language Hide Translation Bar
Craige_Hales
Super User
Using a datatable as a JSL data structure

1000429.jpg Video made with JSL.

Designed for 1920x1080 display.

The JSL uses a data table to keep a row of data per moving point in the video. 

The ForEachRow loops use the column name variables rowpos and colpos to place a point at a row,column in the bitmap matrices and rowstep and colstep to advance the rowpos and colpos for each frame.

dt = New Table( "points", "private", // private is *much* faster
	Add Rows( npoints ), // this table has a row per moving point, location, vector, color
	New Column( "rowpos" ), New Column( "colpos" ), New Column( "rowstep" ), New Column( "colstep" ),
	New Column( "bounce" ), New Column( "rpix" ), New Column( "gpix" ), New Column( "bpix" )
);

Advancing the points for the next frame:


movepoints = Function( {}, // on each frame the points are all advanced and checked for leaving the bitmap
	For Each Row( dt,
		If( 1 <= (dt:rowpos + dt:rowstep) < nr + 1, // hit bottom or top edge?
			0 // not leaving
		, // else...hit the edge
			dt:bounce += 1;
			If( dt:bounce > bounceLimit,
				reset( Row() ) // restart
			, // else keep bouncing
				dt:rowstep = -dt:rowstep // if bouncing, reverse
			);
		);
		If( 1 <= (dt:colpos + dt:colstep) < nc + 1, // hit left or right edge?
			0 // not leaving
		, // else...hit the edge
			dt:bounce += 1;
			If( dt:bounce > bounceLimit,
				reset( Row() ) // restart
			, // else keep bouncing
				dt:colstep = -dt:colstep // reverse
			);
		);
		dt:rowpos += dt:rowstep; // move this point along its path
		dt:colpos += dt:colstep;
	)
);

The complicated if statements are testing if the point is about to leave the frame; an early version used bounceLimit=1 to let them bounce once by reversing the step.

The code is on github.

Last Modified: Jul 2, 2026 4:29 PM