Lasso Soft Inc. > Home

[tags_native]

Linktags_native
AuthorJason Huck
CategoryTags
Version8.x
Licensehttp://opensource.org/licenses/artistic-license.php
Posted28 May 2006
Updated28 May 2006
More by this author...

Description

This tag queries the ldml8_reference database and returns all native tags, excluding hidden tags (i.e., those that start with '_') and member tags. Must be loaded in LassoStartup. Stores and returns results in a global var for speed.

Sample Usage

tags_native;

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(
	'native',
	-namespace='tags_',
	-priority='replace',
	-privileged,
	-description='Returns a set of all native tags.'
);
	if(!global_defined('tags_native'));
		local('tags_native' = set);
	
		local('sql' = '
			SELECT tag_name 
			FROM tags 
			WHERE tag_name LIKE \'[%\'
				AND tag_name NOT LIKE \'%->%\'
				AND tag_name NOT LIKE \'[ ]%\'
			ORDER BY tag_name
		');
				
		inline(
			-database='ldml8_reference',
			-maxrecords='all',
			-sql=#sql
		);
			rows;
				local('tag') = field('tag_name')->split(' ... ')->first;
				#tag->removeleading('[')&removetrailing(']')&lowercase;
				#tags_native->insert(#tag);
			/rows;
		/inline;

		global('tags_native') = #tags_native;
	/if;
	
	return(@global('tags_native'));
/define_tag;

Related Tags

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