-noroutineinwhere - Enum:GetValue() should be exempt... - Forum - OpenEdge Development - Progress Community

-noroutineinwhere - Enum:GetValue() should be exempt...


-noroutineinwhere - Enum:GetValue() should be exempt...

  • Using -noroutineinwhere is good practice to prevent unwanted side effects from using a method or property in a WHERE clause.

    For cases where the method always returns a constant, like Enum:GetValue(), this should be allowed though.

    Even better would be if you could write:

    FOR EACH Document NO-LOCK

    WHERE Document.Status = DocumentStatus:Draft

    Where Status is an integer field

  •  There is an idea about automatically casting during assignments, and I think that the above ability to do the comparison fits in perfectly with that idea. Maybe you should add it as a comment to the idea. (I.e, the compiler can implicitly add the STRING() or INTEGER() or INT64() around the enum in your example above.)


    Simon L Prinsloo