B4J Question Suppress warnings [solved]

Discussion in 'B4J Questions' started by Didier9, Jun 17, 2019.

  1. Didier9

    Didier9 Active Member Licensed User

    As a debug tool, I save custom types to a list which under certain conditions I want to log.
    I have found it expedient (if not necessarily proper) to simply Get() the custom type from the list to a string in my error handling code and Log() the string.
    It works fine but of course, I get a number of warning messages of the type "Object converted to string, this is probably a programming mistake" that are cluttering the Logs window.

    Is there a way to turn off these messages under certain conditions or within a block of code (like the #pragma statements in C)?

    PS: I realize it would be better to actually handle the custom type properly but I use the same routine with several different types and I do not want my debug code to become too complex.
     
  2. DonManfred

    DonManfred Expert Licensed User

    add
    Code:
    #IgnoreWarnings: 10, 12 '<---  replace warningsno to ignore
    to your project attributes
     
    Last edited: Jun 17, 2019
    Didier9 and Erel like this.
  3. Didier9

    Didier9 Active Member Licensed User

    Thanks a lot Don, exactly what I was hoping for!
    Works perfectly too...
     
  4. Johan Hormaza

    Johan Hormaza Active Member Licensed User

    Or
    Code:
    'ignore
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice