« Return to Thread: Define a tag and then can't call it

Re: Define a tag and then can't call it

by Stiti :: Rate this Message:

Reply to Author | View in Thread

If you are using the -Namespace in the define_tag then don't use "_" (underscrore) character in the tag name. Because when you call the custom tag in your program, Lasso always considers the string upto the last "_" character as the namespace of the custom tag and the string after the last "_"character as the Tag Name.
If the string after the last "_"character doesn't matches the Tag Name defined in [Define_tag] and the string before last "_" character doesn't matches the string provided in the "-Namespace" option in Define_Tag and , it returns an error that the "No tag, type or constant was defined under the name lsd_string_toduration".

In your case "lsd_string" is considered as namespace of the tag but it finds only "lsd" as the namespace. Thus it finds no tag defined for the name "lsd_string_toduration". If in the define_tag the tag name will be "ToDuration" and -Namespace="LSD_String", then lsd_string_toduration('help'); statement will be executed successfully.


Brad Lindsay-2 wrote:
Ok, can someone explain to me why this is failing?  I get an error  
saying no tag, type, or constant defined with the name  
lsd_string_toduration!

============================================================
[
define_tag('String_ToDuration', -namespace='LSD', -required='a_string');
     return #a_string;
/define_tag;

lsd_string_toduration('help');
]
============================================================

-Brad

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Thanks
Stiti Samantaray
Mindfire Solutions
www.mindfiresolutions.com

 « Return to Thread: Define a tag and then can't call it