# Cannot get \`OMIT\` working according to the documentation

**URL:** <https://clarionhub.com/t/cannot-get-omit-working-according-to-the-documentation/7664>\
**Category:** questions\
**Created:** [November 15, 2024, 8:38am UTC](https://clarionhub.com/t/cannot-get-omit-working-according-to-the-documentation/7664 "2024-11-15T08:38:37Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThaDaSoft](https://clarionhub.com/user_avatar/clarionhub.com/thadasoft/32/3743_2.png) [@ThaDaSoft](https://clarionhub.com/u/ThaDaSoft)\
**Post date:** [November 15, 2024, 8:38am UTC](https://clarionhub.com/t/cannot-get-omit-working-according-to-the-documentation/7664/1 "2024-11-15T08:38:37Z")

</div>

I am trying to figure out how `OMIT` works - better said I want to eventually create a template in which one can define a value - but I want to have a fallback value, or better said a default value for the equate if it’s not set - but I can’t get the following piece of code to work - it throws a `Unknown Identifier` unless I remove the `OMIT` (comment it out is enough`

```Clarion
OMIT('MyEquateValue', MyEquateValue <> 0)
MyEquateValue EQUATE('TEST')
MyEquate EQUATE(MyEquateValue)

```

The above was inside my .inc file which I include - but it does act the same inside the `Global Data` section - my program is currently Clarion 8 (Legacy)

The thing I don’t understand is that it should only be omitted when it has a value other than `0` - it’s `0` by default if not defined according to the documentation - but clearly it does have a value, otherwise it wouldn’t be omitted right?

---

<div class="post-metadata">

**Author:** ![ThaDaSoft](https://clarionhub.com/user_avatar/clarionhub.com/thadasoft/32/3743_2.png) [@ThaDaSoft](https://clarionhub.com/u/ThaDaSoft)\
**Post date:** [November 15, 2024, 10:09am UTC](https://clarionhub.com/t/cannot-get-omit-working-according-to-the-documentation/7664/2 "2024-11-15T10:09:36Z")

</div>

Got it fixed - apparently it works a little different than I thought- following works:

```Clarion
OMIT('*My Equate*', MyEquate <> 0)
MyEquate EQUATE('TEST')
! *My Equate*

```

---

<div class="post-metadata">

**Author:** ![CarlBarnes](https://clarionhub.com/user_avatar/clarionhub.com/carlbarnes/32/1859_2.png) [@CarlBarnes](https://clarionhub.com/u/CarlBarnes)\
**Post date:** [November 15, 2024, 4:20pm UTC](https://clarionhub.com/t/cannot-get-omit-working-according-to-the-documentation/7664/3 "2024-11-15T16:20:17Z")

</div>

Read the help carefully. If your Expression is just an Equate Label without an operator (no = \<\> ) e.g.

```clarion
   OMIT('xxx', _IncludeMyCode_)
   xxx

```

Of `_IncludeMyCode_`help says

> If the _Expression_ contains an EQUATE that has not yet been defined, then the referenced EQUATE is assumed to be zero (0). COMPILE and OMIT are opposites.

---

<div class="post-metadata">

**Author:** ![ThaDaSoft](https://clarionhub.com/user_avatar/clarionhub.com/thadasoft/32/3743_2.png) [@ThaDaSoft](https://clarionhub.com/u/ThaDaSoft)\
**Post date:** [November 15, 2024, 4:21pm UTC](https://clarionhub.com/t/cannot-get-omit-working-according-to-the-documentation/7664/4 "2024-11-15T16:21:58Z")

</div>

It actually was the way I wrote it - I used the `EQUATE` as terminator and that didn’t work

---

<div class="post-metadata">

**Author:** ![ThaDaSoft](https://clarionhub.com/user_avatar/clarionhub.com/thadasoft/32/3743_2.png) [@ThaDaSoft](https://clarionhub.com/u/ThaDaSoft)\
**Post date:** [February 13, 2025, 2:10pm UTC](https://clarionhub.com/t/cannot-get-omit-working-according-to-the-documentation/7664/5 "2025-02-13T14:10:09Z")

</div>

Here I am again - for some reason it’s still not working - I’ve got the following:

Inside `After Global Includes`

```Clarion
MyEquate EQUATE('I did something')
INCLUDE('MyInclude.inc'),ONCE

```

Inside `MyInClude.inc`

```Clarion
OMIT('*My Equate*', MyEquate <> 0)
MyEquate EQUATE('TEST')
! *My Equate*

```

But further up in the code I MESSAGE the value and it still shows `TEST` instead of the overriden value - so I thought, let’s do it as suggested:

Inside `After Global Includes`

```Clarion
MyEquateOverride EQUATE(1)
MyEquate EQUATE('I did something')
INCLUDE('MyInclude.inc'),ONCE

```

Inside `MyInClude.inc`

```Clarion
OMIT('*My Equate*', MyEquateOverride)
MyEquate EQUATE('TEST')
! *My Equate*

```

But it still shows `TEST` and not `I did something` - any idea @CarlBarnes  
Perhaps it doesn’t work across Program and `.inc`?

---

<div class="post-metadata">

**Author:** ![Julian](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/74df32/32.png) [@Julian](https://clarionhub.com/u/Julian)\
**Post date:** [February 15, 2025, 4:05pm UTC](https://clarionhub.com/t/cannot-get-omit-working-according-to-the-documentation/7664/6 "2025-02-15T16:05:00Z")

</div>

MyEquate is a string = ‘Test’ but you’re comparing it to number = 0

---

<div class="post-metadata">

**Author:** ![ThaDaSoft](https://clarionhub.com/user_avatar/clarionhub.com/thadasoft/32/3743_2.png) [@ThaDaSoft](https://clarionhub.com/u/ThaDaSoft)\
**Post date:** [February 19, 2025, 12:53pm UTC](https://clarionhub.com/t/cannot-get-omit-working-according-to-the-documentation/7664/7 "2025-02-19T12:53:46Z")

</div>

I get that - but even the example with only numbers doesn’t work `MyEquateOverride`

---

<div class="post-metadata">

**Author:** ![Julian](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/74df32/32.png) [@Julian](https://clarionhub.com/u/Julian)\
**Post date:** [February 19, 2025, 1:57pm UTC](https://clarionhub.com/t/cannot-get-omit-working-according-to-the-documentation/7664/8 "2025-02-19T13:57:16Z")

</div>

The help states that the expression is a value of zero or one so don’t use a string, just change..  
`MyEquate EQUATE('TEST')`  
to  
`MyEquate EQUATE(1)`

---

<div class="post-metadata">

**Author:** ![ThaDaSoft](https://clarionhub.com/user_avatar/clarionhub.com/thadasoft/32/3743_2.png) [@ThaDaSoft](https://clarionhub.com/u/ThaDaSoft)\
**Post date:** [February 19, 2025, 2:40pm UTC](https://clarionhub.com/t/cannot-get-omit-working-according-to-the-documentation/7664/9 "2025-02-19T14:40:18Z")

</div>

I’ll repeat myself - the second example, with `MyEquateOverride` doesn’t work either - I repeated it below

Inside `After Global Includes`

```Clarion
MyEquateOverride EQUATE(1)
MyEquate EQUATE('I did something')
INCLUDE('MyInclude.inc'),ONCE

```

Inside `MyInClude.inc`

```Clarion
OMIT('*My Equate*', MyEquateOverride)
MyEquate EQUATE('TEST')
! *My Equate*

```

---

<div class="post-metadata">

**Author:** ![MarkGoldberg](https://clarionhub.com/user_avatar/clarionhub.com/markgoldberg/32/1511_2.png) [@MarkGoldberg](https://clarionhub.com/u/MarkGoldberg)\
**Post date:** [February 19, 2025, 9:57pm UTC](https://clarionhub.com/t/cannot-get-omit-working-according-to-the-documentation/7664/10 "2025-02-19T21:57:02Z")

</div>

> [@Julian](#):
>
> MyEquate is a string = ‘Test’ but you’re comparing it to number = 0

Possibly you didn’t understand, but you’re essentially writing  
` OMIT('*My Equate*', 'I did something' )`

Now, when interpreting the string` 'I did something'` as a NUMBER, it becomes 0  
as the first character is a capital ‘i’ which which is neither a digit nor white space

So I wouldn’t expect it to OMIT the code

---

<div class="post-metadata">

**Author:** ![ThaDaSoft](https://clarionhub.com/user_avatar/clarionhub.com/thadasoft/32/3743_2.png) [@ThaDaSoft](https://clarionhub.com/u/ThaDaSoft)\
**Post date:** [February 20, 2025, 7:52am UTC](https://clarionhub.com/t/cannot-get-omit-working-according-to-the-documentation/7664/11 "2025-02-20T07:52:39Z")

</div>

I’ll repeat myself again as I understand a `STRING` is not a `NUMBER` - the second example, with `MyEquateOverride` doesn’t work either - I repeated it below

Inside `After Global Includes`

```Clarion
MyEquateOverride EQUATE(1)
MyEquate EQUATE('I did something')
INCLUDE('MyInclude.inc'),ONCE

```

Inside `MyInClude.inc`

```Clarion
OMIT('*My Equate*', MyEquateOverride)
MyEquate EQUATE('TEST')
! *My Equate*

```

---

<div class="post-metadata">

**Author:** ![CarlBarnes](https://clarionhub.com/user_avatar/clarionhub.com/carlbarnes/32/1859_2.png) [@CarlBarnes](https://clarionhub.com/u/CarlBarnes)\
**Post date:** [February 22, 2025, 4:23pm UTC](https://clarionhub.com/t/cannot-get-omit-working-according-to-the-documentation/7664/12 "2025-02-22T16:23:31Z")

</div>

> [@ThaDaSoft](#):
>
> Inside `After Global Includes`
> 
> ```auto
> MyEquateOverride EQUATE(1)
> MyEquate EQUATE('I did something')
> INCLUDE('MyInclude.inc'),ONCE
> 
> ```
> 
> Inside `MyInClude.inc`
> 
> ```auto
> OMIT('*My Equate*', MyEquateOverride)
> MyEquate EQUATE('TEST')
> ! *My Equate*
> 
> ```
> 
> But it still shows `TEST` and not `I did something` - any idea

That does not make sense that it shows TEST.

The way it looks to me is you have `Omit( ,1)` so the `EQUATE('TEST')` should be omitted i.e. not compiled. If it did compile it would cause a compile error because MyEquate is defined twice.

Your snippets look ok. The best way to resolve this is to zip up a complete example project and attach it so others can build exactly what you have.

---

<div class="post-metadata">

**Author:** ![MarkGoldberg](https://clarionhub.com/user_avatar/clarionhub.com/markgoldberg/32/1511_2.png) [@MarkGoldberg](https://clarionhub.com/u/MarkGoldberg)\
**Post date:** [February 22, 2025, 8:20pm UTC](https://clarionhub.com/t/cannot-get-omit-working-according-to-the-documentation/7664/13 "2025-02-22T20:20:24Z")

</div>

> [@ThaDaSoft](#):
>
> I’ll repeat myself again

Sorry, I see now that you’re using ,MyEquateOverride as the expression on the condition. My apologies.

Where does MyInclude.inc appear?  
Are there multiple locations?  
Is one of the locations inside of a module that has an empty MEMBER statement?  
If so, then please be aware that the module with empty member statement doesn’t see the global scope.

Note, its often better to use pragma defines for the conditions on omit/compiles  
as they you don’t have scoping problems  
_Note: pragma can be associated with a single module_

What are you expecting to happen?  
Compile time warning about a duplicate label ?

---

<div class="post-metadata">

**Author:** ![ThaDaSoft](https://clarionhub.com/user_avatar/clarionhub.com/thadasoft/32/3743_2.png) [@ThaDaSoft](https://clarionhub.com/u/ThaDaSoft)\
**Post date:** [February 27, 2025, 1:12pm UTC](https://clarionhub.com/t/cannot-get-omit-working-according-to-the-documentation/7664/14 "2025-02-27T13:12:51Z")

</div>

Guess it’s due to my .inc and corresponding .clw having an empty member - so like you say, it doesn’t see the global scope.

How can I use a pragma define?

---

<div class="post-metadata">

**Author:** ![MarkGoldberg](https://clarionhub.com/user_avatar/clarionhub.com/markgoldberg/32/1511_2.png) [@MarkGoldberg](https://clarionhub.com/u/MarkGoldberg)\
**Post date:** [February 27, 2025, 2:54pm UTC](https://clarionhub.com/t/cannot-get-omit-working-according-to-the-documentation/7664/15 "2025-02-27T14:54:52Z")

</div>

> [@ThaDaSoft](#):
>
> How can I use a pragma define?

Create a new file with a .PR or .PRJ extension  
I put it in the same folder as my .CWProj

add lines like  
`#pragma define(MyEquateValue=>On)`  
`#pragma define(MyEquateValue2=>1)`

On is the same as 1  
Off is the same as 0

> Then In the SV.IDE  
> — View \> Solution Explorer  
> ------ Highlight “Projects to Include”  
> ---------- Right Click \> Add Project to Include  
> -------------- In File Dialog set File types to “Legacy Clarion Files”  
> ------------------ Select the .PR|.PRJ file you created
