Another background question on components.  This time, it's about custom
constants files.

*Background*
I break up my code into 'modules', some of which have associated constants.
So, I end up with a few to many (many) constants files, depending on
structure. The point is that I've got a bunch of little constants files,
not one big one. (Thanks again to Cannon Smith for the constants file
generation code.)

*Setup*
I built the component and 4D includes the custom constants and other
resources automatically. All good.

*Problem*
Over in the host database, the constants are visible in the Explorer and
the code executes fine. Then I compile. In that mode, you get an error such
as this one (macOS 4D 16.0):

The argument list for the method named "MessageHub_Unsubscribe" in the
component "MesageHub" is incompatible with the database or component
"MesageHubDemo.4DB".

If I pick 'reopen', 4D loops around and then crashes. This is 100%
reproducible.

Hmmm. I looked at the code in question in the component source and it's
nothing much. I did notice the custom constants. I searched the archives
here and found somewhat similar-sounding problems in the past related to
missing constants.

But my constants aren't missing. At least interpreted. Perhaps they go
missing when 4D compiles as they're not in the host database resource
folder? It doesn't make sense to put them there. Plus, it doesn't help (the
behavior doesn't change.)

To highlight a key point, the error suggests that the problem is happening
inside of the component. I've tried including it compiled and interpreted.
No better.


So, how do you avoid problems like this? Does anyone recognize what I'm
talking about?
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to