# G4P.showMessage ... G4P.WARNING causes error

**URL:** <https://discourse.processing.org/t/g4p-showmessage-g4p-warning-causes-error/18198>\
**Category:** Libraries\
**Created:** [February 27, 2020, 6:18pm UTC](https://discourse.processing.org/t/g4p-showmessage-g4p-warning-causes-error/18198 "2020-02-27T18:18:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PhilHaw](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/philhaw/32/8221_2.png) [@PhilHaw](https://discourse.processing.org/u/PhilHaw)\
**Post date:** [February 27, 2020, 6:18pm UTC](https://discourse.processing.org/t/g4p-showmessage-g4p-warning-causes-error/18198/1 "2020-02-27T18:18:36Z")

</div>

After just updating G4P Library to latest version (4.3.2) from 4.1.3, The following line of code (which worked under 4.1.3):

G4P.showMessage(this, “Not a valid Patch file?”, “Bad Patch Data”, G4P.WARNING);

now gives the error:

_WARNING cannot be resolved or is not a field_.

If I replace the constant G4P.WARNING with an integer (e.g. 3) the error goes away.

When I had a look in GConstants.java in the G4P library source code there is a constant defined as WARN\_MESSAGE and I find that using G4P.WARN\_MESSAGE instead of G4P.WARNING the error goes away.

@quark: were these message constants changed? I didn’t find any reference to it if they were.

Many thanks in advance 🙂

Phil

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [February 27, 2020, 6:24pm UTC](https://discourse.processing.org/t/g4p-showmessage-g4p-warning-causes-error/18198/2 "2020-02-27T18:24:34Z")

</div>

> [@PhilHaw](#):
>
> were these message constants changed? I didn’t find any reference to it if they were.

Yes they were changed in V4.3.0 and reported in the `changes.txt` file in the library download and on my website [here](http://www.lagers.org.uk/g4p/download.html)

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [February 27, 2020, 6:25pm UTC](https://discourse.processing.org/t/g4p-showmessage-g4p-warning-causes-error/18198/3 "2020-02-27T18:25:13Z")

</div>

BTW welcome to the forum 😄

---

<div class="post-metadata">

**Author:** ![PhilHaw](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/philhaw/32/8221_2.png) [@PhilHaw](https://discourse.processing.org/u/PhilHaw)\
**Post date:** [February 27, 2020, 7:46pm UTC](https://discourse.processing.org/t/g4p-showmessage-g4p-warning-causes-error/18198/4 "2020-02-27T19:46:25Z")

</div>

Thanks - I should have read a bit more carefully!

Phil
