Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exiting a MACRO early #299

Open
randyl opened this issue Aug 24, 2022 · 0 comments
Open

Exiting a MACRO early #299

randyl opened this issue Aug 24, 2022 · 0 comments

Comments

@randyl
Copy link
Contributor

randyl commented Aug 24, 2022

Several times I've wanted to exit a MACRO early if some condition is met. I keep thinking RETURN will do this, but it exits the template, not the macro. I guess that works if the macro is in its own template, but many times I have a macro that exists only in the template that uses it.

I'm looking for something like this:

MACRO output_section( value ) BLOCK;
    IF value == 0;
        # display short amount of html for special case
        EXIT;  # exit this macro/block
    END;
    
    # display lots of html for section
END;

# display main html
output_section( 4 );
output_section( 0 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant