Re: Components and custom constants files

2017-04-22 Thread Cannon Smith via 4D_Tech
Hi David,

I can see from your component naming that you used to live in Hawaii! :-)

--
Cannon Smith

> On Apr 22, 2017, at 12:12 AM, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> DaKine.4dbase

**
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
**

Re: Components and custom constants files

2017-04-22 Thread David Adams via 4D_Tech
>The argument list for the method named "MessageHub_Unsubscribe" in the
component "MesageHub"
> is incompatible with the database or component "MesageHubDemo.4DB".

I just ran into the same error today and spent a few hours smacking things
around until it stopped. Based on past threads and a LOT of help from this
list (thanks everyone!), I'm about 100% sure it has something to do with
duplicate constants. Or else something to do with constants being in the
wrong resources folder. Not entirely sure...but I did want to update this
thread for the archives.

For the record, I've now got

MessageHub_Demo
/Components
 DaKine.4dbase
 MessageHub.4dbase
 OBJ_Module.4dbase

MessageHub
   /Components
 DaKine.4dbase
 OBJ_Module.4dbase

Knock wood, it seems to work. I'm going to leave like this for now and see
how it goes. In the past couple of years, I've been trying to be more open
minded about my programming assumptions. That means trying new tools and
techniques, even if I'm skeptical. It's been fun! I've learned a lot,
adopted some new practices, kept some old habits, and much expanded my
breadth of knowledge. Highly recommended. Sadly, it makes me no less
fiercely opinionated, but it has changed my opinions. People that work with
me in the real world or who have met me can report I'm not so shouty in
person.
**
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
**

Re: Components and custom constants files

2017-04-19 Thread Bruno LEGAY via 4D_Tech
Hi David,

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

I think I had a strange error once similar to this.

If I remember (vaguely), I had one he method of the component having the same 
name as one of the constant.
Maybe that's one thing to check...

The error message was not clear at all.

I think I reported it to 4D.

HTH
Bruno
**
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
**

Re: Components and custom constants files

2017-04-19 Thread David Adams via 4D_Tech
On Wed, Apr 19, 2017 at 8:36 PM, Jim Dorrance via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Check for duplicate constants. They really mess things up in a compiled DB.
> I made a method that automatically dumps all constants from all xlf files
> into an array and then checks for doubles.
>

That sounds like very good advice, thanks. And thanks to everyone for their
quick suggestions and help. Jim, is there any chance that you would be
willing to share your xlf to array code? I can write it, but it's a bit
tedious. If you can't share it, thanks anyway for the suggestion.
**
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
**

Re: Components and custom constants files

2017-04-19 Thread Jim Dorrance via 4D_Tech
Check for duplicate constants. They really mess things up in a compiled DB.
I made a method that automatically dumps all constants from all xlf files
into an array and then checks for doubles.




-- 
Jim Dorrance
jim.dorra...@gmail.com
4...@dorrance.eu
www.4d.dorrance.eu

PS: If you know of anyone that needs an experienced 4D programmer to add
energy and experience to their team, please let me know. I have
experience in many areas. Reasonable rates. Remote or Paris only.
**
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
**

Re: Components and custom constants files

2017-04-19 Thread Jim Dorrance via 4D_Tech
-- 
Jim Dorrance
jim.dorra...@gmail.com
4...@dorrance.eu
www.4d.dorrance.eu

PS: If you know of anyone that needs an experienced 4D programmer to add
energy and experience to their team, please let me know. I have
experience in many areas. Reasonable rates. Remote or Paris only.
**
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
**

Re: Components and custom constants files

2017-04-19 Thread David Adams via 4D_Tech
On Wed, Apr 19, 2017 at 5:44 PM, Wayne Stewart via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> David,
>
> Definitely use constants!
>

I love constants and my component's source is full of them. But now I'm a
bit spooked about constants shared with a host database. What's the best
practice recommendation on that? I didn't find much in the docs. Then
again, it might be there and I missed it - that's already been the case a
couple of times with my questions about components.
**
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
**

Re: Components and custom constants files

2017-04-19 Thread Wayne Stewart via 4D_Tech
David,

Definitely use constants!


Regards,

Wayne


[image: --]
Wayne Stewart
[image: http://]about.me/waynestewart



On 19 April 2017 at 17:25, David Adams via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> I'm back. Okay, I went into the host structure and stomped on any reference
> to component constants. I also went back into the component source and
> cleared out some duplicate recourses. What I mean is, forms/tables/methods
> that shared names with the host. The way this database started is as one
> structure. Then I figured, "Hey! Too much plumbing. Hard to follow. Hide
> the plumbing." So I duplicated the structure and purged a bunch of stuff
> from the demo and a bunch from the component source. So there were plenty
> of duplicate things. This is exactly what lead me to discover the
> (documented) behavior regarding method names that Miyako explained.
>
> Sidebar: Keisuke Miyako, how do you prefer your name? On this list we seem
> to say "Miyako", but I'm wondering if you go by "Kiesuke" or anything else.
>
> So, I haven't a clue what was in conflict, something was, it only showed up
> in a compiled host, and no component code was called.
>
> Speaking of components and constants, what is the recommended strategy? It
> would be nice to include some but now I'm a bit wary
> **
> 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
> **
>
**
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
**

Re: Components and custom constants files

2017-04-19 Thread David Adams via 4D_Tech
I'm back. Okay, I went into the host structure and stomped on any reference
to component constants. I also went back into the component source and
cleared out some duplicate recourses. What I mean is, forms/tables/methods
that shared names with the host. The way this database started is as one
structure. Then I figured, "Hey! Too much plumbing. Hard to follow. Hide
the plumbing." So I duplicated the structure and purged a bunch of stuff
from the demo and a bunch from the component source. So there were plenty
of duplicate things. This is exactly what lead me to discover the
(documented) behavior regarding method names that Miyako explained.

Sidebar: Keisuke Miyako, how do you prefer your name? On this list we seem
to say "Miyako", but I'm wondering if you go by "Kiesuke" or anything else.

So, I haven't a clue what was in conflict, something was, it only showed up
in a compiled host, and no component code was called.

Speaking of components and constants, what is the recommended strategy? It
would be nice to include some but now I'm a bit wary
**
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
**

Re: Components and custom constants files

2017-04-19 Thread David Adams via 4D_Tech
On Wed, Apr 19, 2017 at 4:33 PM, Wayne Stewart via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> David,
>
> I've never seen this.
>

I have a gift for this sort of thing ;-)
**
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
**

Re: Components and custom constants files

2017-04-19 Thread Wayne Stewart via 4D_Tech
David,

I've never seen this.


Regards,

Wayne


[image: --]
Wayne Stewart
[image: http://]about.me/waynestewart



On 19 April 2017 at 16:28, Jim Dorrance via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> I use constants in components all the time and I have never experienced
> this problem. If you regenerate constants often, perhaps just to make a
> minor spelling change, perhaps the modified constants are not tokenised.All
> my constants start with 'k', so I do a search and replace of 'k' (case
> sensitive) and replace with 'k'. That tokenises everything.
>
> Also, if the component has been compiled and the constants are only used in
> the component, this component code is executed on startup in the host db:
>
> *If *(*_pgComponentIsCompiled_bGET *)
>
> *_pgOnHostStartup *
>
> *End if *
>
> where *_pgOnHostStartup *deletes the constants file. That way the constants
> are not visible in the host db.
>
>
> On Wed, Apr 19, 2017 at 6:10 AM, David Adams via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
>
> > One more detail: No component code is being invoked. I removed all
> startup
> > code in the host. No matter, you still get the error. Compiled only.
> > **
> > 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
> > **
> >
>
>
>
> --
> Jim Dorrance
> jim.dorra...@gmail.com
> 4...@dorrance.eu
> www.4d.dorrance.eu
>
> PS: If you know of anyone that needs an experienced 4D programmer to add
> energy and experience to their team, please let me know. I have
> experience in many areas. Reasonable rates. Remote or Paris only.
> **
> 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
> **
>
**
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
**

Re: Components and custom constants files

2017-04-19 Thread Jim Dorrance via 4D_Tech
I use constants in components all the time and I have never experienced
this problem. If you regenerate constants often, perhaps just to make a
minor spelling change, perhaps the modified constants are not tokenised.All
my constants start with 'k', so I do a search and replace of 'k' (case
sensitive) and replace with 'k'. That tokenises everything.

Also, if the component has been compiled and the constants are only used in
the component, this component code is executed on startup in the host db:

*If *(*_pgComponentIsCompiled_bGET *)

*_pgOnHostStartup *

*End if *

where *_pgOnHostStartup *deletes the constants file. That way the constants
are not visible in the host db.


On Wed, Apr 19, 2017 at 6:10 AM, David Adams via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> One more detail: No component code is being invoked. I removed all startup
> code in the host. No matter, you still get the error. Compiled only.
> **
> 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
> **
>



-- 
Jim Dorrance
jim.dorra...@gmail.com
4...@dorrance.eu
www.4d.dorrance.eu

PS: If you know of anyone that needs an experienced 4D programmer to add
energy and experience to their team, please let me know. I have
experience in many areas. Reasonable rates. Remote or Paris only.
**
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
**

Re: Components and custom constants files

2017-04-18 Thread Keisuke Miyako via 4D_Tech
maybe one or more constants are redefining default 4D constants with a 
different type.

> 2017/04/19 13:01、David Adams via 4D_Tech <4d_tech@lists.4d.com> のメール:
> The argument list for the method named "MessageHub_Unsubscribe" in the
> component "MesageHub" is incompatible with the database or component
> "MesageHubDemo.4DB".




**
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
**

Re: Components and custom constants files

2017-04-18 Thread David Adams via 4D_Tech
One more detail: No component code is being invoked. I removed all startup
code in the host. No matter, you still get the error. Compiled only.
**
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
**

Components and custom constants files

2017-04-18 Thread David Adams via 4D_Tech
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
**