Re: Parsing problem using constants

new topic     » goto parent     » topic index » view thread      » older message » newer message
zebra said...
zebra said...


When using constants like MB_YESNO in messagebox the parser does not recognize
it and reports an error.
If I substitute the value 4 in its place it works ok.

I then tried replacing MB_YESNO from a different library ( my own constants ).
It still failed.

I changed public to global
It still failed.

I tried substituting msgbox.e library with ver3.11 msgbox.e library.
It still failed.

This seems to indicate something is wrong with the parsing of constants
when it is being used inside of a function or procedure.



I have figured out what is causing my problem.

I am including msgbox.e from another file via the PUBLIC INCLUDE ( scope )

If you try to use a PUBLIC CONSTANT from a PUBLIC INCLUDE file the
parser does not see it.

But you have use the NAMESPACE scope ( EXAMPLE : msgbox:MB_YESNO then the parser
doesn't error out and my program works properly.

I don't think that is the problem because referencing a public constant from any included file (public or otherwise) works just fine.

The fact that you needed to use a namespace qualifier seems to indicate that the real problem is that the name 'MB_YESNO' is being included twice (or more) from different files and Euphoria needed your help to tell it which one you really wanted to refer to.

I'll see if we can improve the error message. As it is, Euphoria is telling you ("Errors resolving the following references:") that it can't workout what you mean when you reference 'MB_YESNO'. This could be because it doesn't know about anything of that name OR that there are multiple items with that name in scope.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu