SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Non-Member
    Join Date
    Feb 2010
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Custom Lasso tag to check existence of a GET/POST parameter in Lasso script

    Hi all,
    i am sharing a tip relating to relating to filemaker.hope it would be useful.
    This is a custom lasso tag which takes the name of HTTP-POST or GET parameter (submitted through form-posting for example) as argument and returns a Boolean value to indicate whether that parameter is found. It returns true if a parameter with that name is found in the set of HTTP POST/GET parameters and false if the parameter is not found.

    This Lasso custom tag is like isset() function in PHP.



    <?LassoScript

    define_tag: 'status', -Required='param';
    local: 'theVar'=(action_params);
    local: 'theRecordMap'= (map);

    loop: (#theVar->size);
    local: 'tempElement'=(#theVar->(get: (loop_count)));
    #theRecordMap->(insert: (#tempElement->First)=(#tempElement->Second));
    /loop;

    local: 'keys' = #theRecordMap->keys;
    local: 'status' = 'false';

    loop: (#keys->size);
    if: (#keys->(get:loop_count)==#param);
    local: 'status'='true';
    /if;
    /loop;

    return: #status;
    /define_tag;
    ?>


    Sample Usage script
    if((status: -param='age')=='true');
    Variable: 'agerange' = (Action_Param:'age');
    /if;

    Any suggestions are welcomed.

  2. #2
    Non-Member
    Join Date
    Feb 2010
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is a custom lasso tag which takes the name of HTTP-POST or GET parameter (submitted through form-posting for example) as argument and returns a Boolean value to indicate whether that parameter is found. It returns true if a parameter with that name is found in the set of HTTP POST/GET parameters and false if the parameter is not found.

    This Lasso custom tag is like isset() function in PHP.



    <?LassoScript

    define_tag: 'status', -Required='param';
    local: 'theVar'=(action_params);
    local: 'theRecordMap'= (map);

    loop: (#theVar->size);
    local: 'tempElement'=(#theVar->(get: (loop_count)));
    #theRecordMap->(insert: (#tempElement->First)=(#tempElement->Second));
    /loop;

    local: 'keys' = #theRecordMap->keys;
    local: 'status' = 'false';

    loop: (#keys->size);
    if: (#keys->(get:loop_count)==#param);
    local: 'status'='true';
    /if;
    /loop;

    return: #status;
    /define_tag;
    ?>
    Eliza
    Last edited by DaveMaxwell; Mar 24, 2010 at 09:08.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •