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

RE: [amibroker] Re: Export to Metastock format



PureBytes Links

Trading Reference Links


Hi Dave,
 
To echo Tomasz points, I've done this and it works very well.  So, in essence, you can get your hands on any array in the function as long as you declar it as global.
 
Regards,
GaryTomasz Janeczko <amibroker@xxxxxx> wrote:
Dave,Yes but you should use global keyword inside function to make sureit is treates variables as global and you don't need to declare them before function call:function SetTwoArrays(){global staReturn1, staReturn2;staReturn1 = C;staReturn2 = ROC( C, -1 );return MACD(); // you can return 3rd array}SetTwoArrays();//staReturn1 and staReturn2 variables are accessible there;WriteVal( staReturn1);WriteVal( staReturn2 );Hope this helps.Best regards,Tomasz Janeczkoamibroker.com----- Original Message ----- From: "Dave Merrill" To: "AmiBroker list" Sent: Sunday, February 01, 2004 6:56 PMSubject: [amibroker] returning more than one array from a function> Say I have a function that I'd like to have return two
 arrays. As far as I> know, there's no direct way to do that, but I'd like to confirm this for> certain, since it would be very handy, and allow better coding practices.> > The closest we can come I think is to set some variables outside the> function, before calling it, so they're global, and have the function set> them. What I don't like about this is that in contrast to some other> languages, the names of those variables have to be hard coded inside the> function. I'd much rather pass the names of the result arrays to use (or> pointers to them) into the function.> > For example:> > ResultArrayOne = ResultArrayTwo = Null;> function SetTwoArrays() {> ResultArrayOne = C;> ResultArrayTwo = ROC(C, 1);> }> > You have to use the variables named ResultArrayOne and ResultArrayTwo for> this function to work correctly; those variables are what it sets,
 no matter> what.> > Do I have it right that this is the only way to get more than one array back> from a function?> > Dave Merrill> > > 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 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/ >
 > > Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend 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 LexmarkPrinter at MyInks.com. Free s/h on orders $50 or more to the US & Canada.http://www.c1tracking.com/l.asp?cid=5511http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM---------------------------------------------------------------------~->Yahoo! Groups LinksTo 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@xxxxxxxxxxxxxxxYour use of Yahoo! Groups is subject to:http://docs.yahoo.com/info/terms/ 
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!


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


  ADVERTISEMENT 









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 the Yahoo! Terms of Service.