Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Confirmation requested: Appery will use last instance of two functions with same name in same library.

Hello,

Could you clarify your question?

You can get array of components with the same name via jQuery:

var arr = $("[name=comnponentName]");

RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

Confirmation requested: Appery will use last instance of two functions with same name in same library.

Sorry for not being clear. Suppose in my JS file I have a function on line 200. Then, on line 400, I have a function with the same name but slightly different content. When my app calls that function, which one will be invoked? According to that stackoverflow post, it will be the one on line 400. Can I assume that's always the case with Appery. Thanks.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Confirmation requested: Appery will use last instance of two functions with same name in same library.

The best way is don't use functions with the same name.

RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

Confirmation requested: Appery will use last instance of two functions with same name in same library.

Sergiy - it's frankly annoying that in four days your response is to a non-asked question (I already know it's best not to duplicate names). But responding to your non-answer let me say this: what would really best is for the Appery editor to alert the user to duplicate function names at least within the same file; and if that's not possible, to at least allow searches and finds to extend beyond the immediate editor view which it does not do (at least in Firefox).

FYI, my question came about because of a whole bunch of same-named (but potentially slightly different) functions existing in the same file - probably from some inadvertent copy-and-pastes on my part. Since the app is working fine, I wanted to delete superfluous functions and thought knowing whether they were the first or last-occurring would have hastened the process.

In any case, I'll proceed on my own.

Return to “Issues”