On Tue, Apr 18, 2017 at 4:59 PM, Keisuke Miyako via 4D_Tech <
[email protected]> wrote:

> Hello,
>



> Structure file=Structure file(*)

> this is documented (see example 2)
> http://doc.4d.com/4Dv15/4D/15.4/Structure-file.301-3274414.en.html

Great trick! That answers one of the two questions that I didn't even ask,
nicely done.

> + when the host and component share the same methods names

Thanks for the link to the right discussion. I read it over a few times and
I think I understand now. So, components don't give us something comparable
to a namespace. All methods are blended together somehow when the system
starts up. So if there are duplicate names in the host/component/other
components, you've potentially got a problem.

> name conflicts of this sort are reported by the compiler, if the call is
tokenised.

Exactly the problem - 4D doesn't recognize methods passed as strings as
methods. There's nothing like

C_TEXT(MyWonderfulMethod;$1;Is a Method Name)

I thought that I'd put in such a feature request, but it's not showing up
in the forums. Oh well.

As far as I know, the only way that I can detect and screen for method name
conflicts at runtime is by calling METHOD GET NAMES. You can choose to scan
the component or the host, so you can get two lists. That feels expensive
to me, but perhaps I'm wrong about that. To make this more efficient, I'd
want to call METHOD GET NAMES once when I start my worker and stash the
method list. That's fine for the component as it won't change at runtime.
But, is there a way to find out if the host is compiled without having the
host pass that information into the component? Will the host structure name
always end in .4DC, .APP or .EXE if its compiled? Not sure how to test the
Is compiled property of the host...

Thanks again for the great answer so far and any additional help you can
offer.
**********************************************************************
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:[email protected]
**********************************************************************

Reply via email to