Skip to content

Add directive to test for symbol definition #88

Description

@chriskillpack

Quoting from https://stardot.org.uk/forums/viewtopic.php?p=370117#p370117

I've been playing around with MACROs in RC2.
Is there a way to do an IF on something being defined? An EXISTS or DEFINED keyword?
What I want to do is...

MACRO testdefined label
	foo = label+"_suffix"
	IF DEFINED(EVAL(foo))
		PRINT foo," exists"
	ELSE
		PRINT foo," doesn't exist"
	ENDIF
ENDMACRO

bar_suffix = 10

testdefined bar
testdefined baz

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions