1. ma jack
  2. PowerBuilder
  3. Thursday, 13 April 2023 15:03 PM UTC

Hello everyone
I got this warning when I migrated the project to 2019R3
C0146:The identifier 'message' conflicts with an existing global variable with this name.

The new definition of 'message' will take precedence and the prior value will be ignored until this version of 'message' goes out of scope.

I found this sentence in https://docs.appeon.com/pb2022/application_techniques/The_Message_object.html :The Message object is a predefined PowerBuilder global object

I thought this warning was caused by repeated definition of message in the code, but only message is defined in application

forward
global type tpbl from application
end type
global transaction sqlca
global dynamic description area sqlda
global dynamic stagingarea sqlsa
global error error
global message message
end forward

Clicking the error line number of the warning prompt cannot jump to the location where the error occurred


What else could cause this warning to occur? Can this warning be ignored?

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 13 April 2023 16:47 PM UTC
  2. PowerBuilder
  3. # 1

Hi Ma;

  Yes, the name "message" is a PB reserved word as it's part of PB's "System Class" (base ancestors).

FYI:  https://docs.appeon.com/pb2022/powerscript_reference/xREF_80481_Reserved_words.html

HTH
Regards ... Chris

Comment
  1. John Fauss
  2. Friday, 14 April 2023 16:21 PM UTC
Bug report 10078 has been created, as requested.
  1. Helpful
  1. ma jack
  2. Saturday, 15 April 2023 04:31 AM UTC
Yes, this is an event mapped to pbm_setcursor, although this warning can be ignored, but I will find another event to replace it.

thank you all
  1. Helpful
  1. Sam Vafadar
  2. Thursday, 18 May 2023 22:23 PM UTC
Im having a similar problem and getting a warning message when compiling. Is is possible to explain how to disable the warnings? I'm using PBAutoBuild220.exe.

Thanks,

Sam
  1. Helpful
There are no comments made yet.
Francisco Martinez @Appeon Accepted Answer Pending Moderation
  1. Thursday, 13 April 2023 16:01 PM UTC
  2. PowerBuilder
  3. # 2

Hi Jack,

 

Message is a global variable mainly used to pass data into and from windows (Message.StringParm|PowerObjectParm). This is already integrated into the PB Environment, so that's where you're getting the conflict.

 

Regards,
Francisco

Comment
  1. Benjamin Gaesslein
  2. Friday, 14 April 2023 10:45 AM UTC
There's no way to change argument names for predefined events. But you can just ignore the warning.
  1. Helpful 1
  1. Francisco Martinez @Appeon
  2. Friday, 14 April 2023 14:13 PM UTC
Jack, you can change the argument's identifier by editing the object's source code (Right click/edit source)
  1. Helpful
  1. ma jack
  2. Saturday, 15 April 2023 04:34 AM UTC
This seems to be a small bug, I will replace it with another event, so that the warning does not appear :)
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.