# Thread: Nested functions

1. ## Nested functions

Hi
While I was going through some postings regarding the similarity of TSL with C a thought got in to my mind. Are Nested functions allowed in TSL? Logic says no and I think in that way. Or is it possible to implement it in any other way?

2. ## Re: Nested functions

<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by anoopt:
Hi
While I was going through some postings regarding the similarity of TSL with C a thought got in to my mind. Are Nested functions allowed in TSL? Logic says no and I think in that way. Or is it possible to implement it in any other way?
<HR></BLOCKQUOTE>

If you mean "can you call another function from within a function?" - the answer is yes.
(recursion is possible)

------------------
JP

[This message has been edited by jpensyl (edited 09-16-2002).]

3. ## Re: Nested functions

Thanks
I was not refering to recursion. So to call a function we will have to define it befor this function right? Or is a declaration enough? Does the TSL strictly follow C when it comes to advanced programming features?

4. ## Re: Nested functions

<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by anoopt:
Thanks
I was not refering to recursion. So to call a function we will have to define it befor this function right?

Yes.

Or is a declaration enough?

If you mean a stub as in below - yes.
function abcd (a, b){
#stub
}
Does the TSL strictly follow C when it comes to advanced programming features?<HR></BLOCKQUOTE>

Depends upon what you mean by advanced.
No need to worry about pointers in TSL.

------------------
JP

5. ## Re: Nested functions

<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by jpensyl:
If you are referring to recursion - no<HR></BLOCKQUOTE>

I disagree. Attached is an example of a recursive WinRunner function:

------------------

6. ## Re: Nested functions

By advance I didnt mean advanced WinRUnner concepts.. but a stuffs like recursion, implementation of structures, multi dimensional arrays etc...

------------------
"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)

7. ## Re: Nested functions

Recursion - Yes.

Structures - No, although you can use string subscripts in a two dimensional array to simulate.

Multidimensional Arrays - Yes, but they're not like arrays in other languages - not contiguous in memory - actually more like a linked list.

------------------

8. ## Re: Nested functions

<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by anoopt:
By advance I didnt mean advanced WinRUnner concepts.. but a stuffs like recursion, implementation of structures, multi dimensional arrays etc...

<HR></BLOCKQUOTE>

Multi-dimensional arrays = Yes

Structures = Pseudo-structures as I will call them - through the use of assignment statements. (no "struct" support, however)

Recursion = Yes

I recommend looking over the documentation - especially the TSL Help section.

------------------
JP

[This message has been edited by jpensyl (edited 09-16-2002).]

9. ## Re: Nested functions

Recursion does work in TSL as mentioned by bpolitzer

10. ## Re: Nested functions

<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by anoopt:
Recursion does work in TSL as mentioned by bpolitzer<HR></BLOCKQUOTE>

Yes - recursion does work - at least from within a function. I just learned something!
(I must have had a mental pointer astray back when I last tried it!)

------------------
JP

[This message has been edited by jpensyl (edited 09-16-2002).]

Page 1 of 2 12 Last

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:30 PM.