Lasso Soft Inc. > Home

[jh_arrayofpositions]

Linkjh_arrayofpositions
AuthorJames Harvard
CategoryArray
Version7.x
LicensePublic Domain
Posted29 Nov 2009
Updated29 Nov 2009
More by this author...

Description

Sample Usage

var( 'sort_column_values' = array );

rows;
	$sort_column_values->insert( integer(field('col_name')) );
/rows;

var( 'positions' = jh_arrayofpositions($sort_column_values) );

'';
rows;
	'';
/rows;
'
'; field('col_name'); ''; $positions->get(loop_count); '
';

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.

define_tag( 'jh_arrayofpositions', -required='a', -type='array' );
	local( 'i' = null, 'out' = array, 'indx' = null );
	#out->reserve( #a->size );
	iterate( #a, #i );
		#indx = #a->findindex(#i) ;
		#out->insert( #indx->last + ( #indx->size != 1 ? '=' ) );
	/iterate;
	return( @ #out );
/define_tag;

Comments

No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft