[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Function calls



PureBytes Links

Trading Reference Links

Bill,

Thats pretty much it, although you can also have a return statement if you wish. So any global variables in your function are in addition to whatever is returned using the return statement. You have access to those global variables created in your function from outside of that function.

>1) There is no "Return" statement in the Function definition.

Actually you can have a return statement if you wish.

>2) I use the "Return" statement to get a single variable:
>x = "FunctionName"(arguements); 
>Now x is defined.

Correct.

>3) If I declare Global variables, they can be recalculated in the 
>function statements and they automatically are returned to the main 
>program at their recalculated values.

Yes, they are recalculated when you call the function. And because their scope is 'Global' their values are available from outside of the function.

>4) To return values, I don't have to have a statement like:
>x = Test(VariableA, VariableB, etc.); 
>I can just use: "Test();" To call the function.

Correct. And then use global variables in your function to pass on the values.


Its quite easy to experiment and test this so you know what is going on. Hope that helps.

Regards,
William Peters
www.amitools.com



-----Original Message-----
From: BillBarack [mailto:wbarack@xxxxxxxxxxx]
Sent: Friday December 26, 2003 1:50 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: Function calls


William,

I saw that example but didn't know how to interpret it. Let me make a 
guess at an interpretation and please correct me if I'm wrong.

   1) There is no "Return" statement in the Function definition.
   2) I use the "Return" statement to get a single variable:
      x = "FunctionName"(arguements); 
      Now x is defined.
   3) If I declare Global variables, they can be recalculated in the 
function statements and they automatically are returned to the main 
program at their recalculated values.
   4) To return values, I don't have to have a statement like:
      x = Test(VariableA, VariableB, etc.); 
      I can just use: "Test();" To call the function.

Thanks, 

Bill



Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Yahoo! Groups Links

To visit your group on the web, go to:
 http://groups.yahoo.com/group/amibroker/

To unsubscribe from this group, send an email to:
 amibroker-unsubscribe@xxxxxxxxxxxxxxx

Your use of Yahoo! Groups is subject to:
 http://docs.yahoo.com/info/terms/