Skip to main content
Question

Compiler Directives

  • June 10, 2022
  • 2 replies
  • 0 views

Nivethan Thiyagarajah
I'm trying to conditionally compile some code but I can't seem to get the IFDEF to work.

This is the source code below, I would expect to see 'Not defined.' but running the program results in 'Defined' being printed. This D3 10.2.2 on Windows if that helps.

*
$IFDEF PLATFORM.D3
PRINT 'Defined.'
$ELSE
PRINT 'Not defined.'
$ENDIF
*
PRINT 'Always print'

Thank you

2 replies

Brian Cram
Forum|alt.badge.img+3
  • Rocketeer
  • June 10, 2022
I'm trying to conditionally compile some code but I can't seem to get the IFDEF to work.

This is the source code below, I would expect to see 'Not defined.' but running the program results in 'Defined' being printed. This D3 10.2.2 on Windows if that helps.

*
$IFDEF PLATFORM.D3
PRINT 'Defined.'
$ELSE
PRINT 'Not defined.'
$ENDIF
*
PRINT 'Always print'

Thank you
I believe that stuff was added in 10.3, but I'll check.

Nivethan Thiyagarajah
I'm trying to conditionally compile some code but I can't seem to get the IFDEF to work.

This is the source code below, I would expect to see 'Not defined.' but running the program results in 'Defined' being printed. This D3 10.2.2 on Windows if that helps.

*
$IFDEF PLATFORM.D3
PRINT 'Defined.'
$ELSE
PRINT 'Not defined.'
$ENDIF
*
PRINT 'Always print'

Thank you
You are correct, 10.3 seems to work as expected.

Thanks!