NexusFi: Find Your Edge


Home Menu

 





Method within a method


Discussion in EasyLanguage Programming

Updated
    1. trending_up 465 views
    2. thumb_up 0 thanks given
    3. group 3 followers
    1. forum 4 posts
    2. attach_file 1 attachments




 
Search this Thread

Method within a method

  #1 (permalink)
nfgrufio
Atlanta, GA
 
Posts: 14 since Apr 2023
Thanks Given: 1
Thanks Received: 0

Is it possible to have a method within a method?

I would think this was possible, but the attached code is not accepted.

Thanks!

Attached Images
 
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Better Renko Gaps
The Elite Circle
Cheap historycal L1 data for stocks
Stocks and ETFs
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Quantum physics & Trading dynamics
The Elite Circle
 
  #2 (permalink)
Imsed1970
Seattle, WA, USA
 
Posts: 13 since Sep 2023
Thanks Given: 0
Thanks Received: 3

yes you can, its called "nested methods" ... you have not defined and declared the child method before you can call it.

Reply With Quote
  #3 (permalink)
nfgrufio
Atlanta, GA
 
Posts: 14 since Apr 2023
Thanks Given: 1
Thanks Received: 0



Imsed1970 View Post
yes you can, its called "nested methods" ... you have not defined and declared the child method before you can call it.

Thank you for the response.
Although I’m not sure I understand.

Would I declare the child() method outside of parent(), in the same manner parent() has been declared?

Could you post an example?

Reply With Quote
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

nfgrufio,

I do not think the TS compiler will let you declare a method within another method. However, since you can call methods from within a method where do you see the benefit in declaring the method inside your parent method versus declaring it outside of it?

Regards,

ABCTG

Follow me on Twitter Reply With Quote
  #5 (permalink)
nfgrufio
Atlanta, GA
 
Posts: 14 since Apr 2023
Thanks Given: 1
Thanks Received: 0


ABCTG View Post
nfgrufio,

I do not think the TS compiler will let you declare a method within another method. However, since you can call methods from within a method where do you see the benefit in declaring the method inside your parent method versus declaring it outside of it?

Regards,

ABCTG

Yes, that is correct. Thank you for clarifying that for me!
I see now that just by calling a method inside another method, you are using nested methods.

Reply With Quote




Last Updated on October 2, 2023


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts