Forum Discussion
Hi,
One precaution based on real experience before you went too far this way:
a) TestComplete does not provide any intellisense or navigational means that display those internal functions;
b) Internal functions cannot be 'included' from another file and all their body must be provided inline.
The result of the two points from above will be that you will get a long file with no hints as for what internal functions it contains and the means to quickly navigate to them.
So you will have to remember the internal contents of the top-level functions (or manage this content some other way) and code debugging will be less convenient as well.
In the inherited progect that I mentioned as real experience we refused from internal functions as it was too inconvenient.
- cunderw6 years agoCommunity Hero
There are a few feature requests to allow the intellisense to include these internal methods and better support classes when using JavaScript, the day that is implemented will make me sooooo happy.
- jmarkman6 years agoOccasional Contributor
a) TestComplete does not provide any intellisense or navigational means that display those internal functions;
I noticed this, it's rather inconvenient even if I have that file commented thoroughly, because even with comments someone else would have to dive into the file instead of just being able to get some intellisense on it.
b) Internal functions cannot be 'included' from another file and all their body must be provided inline.
I don't understand; is this in regards to having to copy over this file if a related project is created? I thought this is what USEUNIT allowed for.
Regardless, I'll keep these points in mind.
- AlexKaras6 years agoChampion Level 3
Hi,
> I don't understand; [...]
No. I meant that the whole body of the internal function must be provided inline.
I.e. you must write
function InformationGrid() { this.Grid = parentElement.FindChild("className", "info_container", 3); this.GetDogName = function(rowIndex) { Log.Message(name); } }
but cannot write like this (pseudocode):
function InformationGrid() { this.Grid = parentElement.FindChild("className", "info_container", 3); this.GetDogName = function(rowIndex) { //USEUNIT GetDogName.js; // <== a kind of include } }
For the non-trivial internal functions, combined with absent navigation/intellisense for internal functions (and absense of something like header files in C\C++ (.h files)), the result of this will be that you will have to continuously scroll up and down through the file in order to locate the function that you need.
Yes, in runtime everything works as expected, but it was exactly because of debug/navigation inconveniences we stopped using internal functions in our project.
- jmarkman6 years agoOccasional Contributor
Ah, I see. Thanks for clarifying, I appreciate it.
Related Content
Recent Discussions
- 2 hours agoSvetaG