Skip to content

Commit

Permalink
Merge pull request #16864 from JamesDeFabia/HPCC-24982
Browse files Browse the repository at this point in the history
HPCC-24982 Clarify how to conditionally compile using __TARGET_PLATFORM__

Reviewed-By: Richard Taylor <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Jan 24, 2023
2 parents 1a145b0 + fee7b84 commit 1da9583
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion docs/EN_US/ECLLanguageReference/ECLR_mods/Basics-Constants.xml
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,18 @@ MyDec2 := 3.14159265358979323846d // value of MyDec2 is the DECIMAL
</tgroup>
</informaltable>Example:</para>

<para><programlisting>IMPORT STD;
<para><programlisting>// Any modules referenced inside the condition must be declared outside of the condition
// This will avoid syntax errors
prod_thor_dali := _Control.IPAddress.prod_thor_dali;
#IF(_TARGET_PLATFORM_ in ['thorlcr'])
Output('thor');
prod_thor_dali;
#ELSE
Output('not thor');
#END

//Second example
IMPORT STD;
STRING14 fGetDateTimeString() :=
#IF(__ECL_VERSION_MAJOR__ &gt; 5) or ((__ECL_VERSION_MAJOR__ = 5) AND (__ECL_VERSION_MINOR__ &gt;= 2))
STD.Date.SecondsToString(STD.Date.CurrentSeconds(true), '%Y%m%d%H%M%S');
Expand Down

0 comments on commit 1da9583

Please sign in to comment.