Forex



Go Back   Forex Trading > Training > Metatrader > Metatrader 4 mql 4 - Development course > Questions






Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 06-23-2006, 02:25 PM
intelligent_14's Avatar
Junior Member
 
Join Date: Mar 2006
Location: Tehran/Iran
Posts: 24
intelligent_14 is on a distinguished road
Unusual Functions

Hi everybody

I'm wondering how i can define one special function that returns an Array
All definable function only return one variable not Array!

can anyone help me?

Thanks
__________________
there wil be nothig for a person exept his efforts (Emam Ali Alayhesalam)
M.A.Gh
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #2 (permalink)  
Old 06-23-2006, 03:46 PM
elihayun's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 388
elihayun is on a distinguished road
Quote:
Originally Posted by intelligent_14
Hi everybody

I'm wondering how i can define one special function that returns an Array
All definable function only return one variable not Array!

can anyone help me?

Thanks
As far as I know there is no way to return an array, but u can use the following technique

double MyFunc(int shift)
{
static double a[100];
static bool firstTime = true;
if (firstTime)
{
firstTime = false;
<fill up the array>
}
return a[shift];
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #3 (permalink)  
Old 06-23-2006, 08:16 PM
intelligent_14's Avatar
Junior Member
 
Join Date: Mar 2006
Location: Tehran/Iran
Posts: 24
intelligent_14 is on a distinguished road
Quote:
Originally Posted by elihayun
As far as I know there is no way to return an array, but u can use the following technique

double MyFunc(int shift)
{
static double a[100];
static bool firstTime = true;
if (firstTime)
{
firstTime = false;
<fill up the array>
}
return a[shift];
}
thanks Elihayun, but this function return only one number (a[shift]) i wants it to return all of "a[]" array not a[shift]
__________________
there wil be nothig for a person exept his efforts (Emam Ali Alayhesalam)
M.A.Gh
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #4 (permalink)  
Old 06-24-2006, 12:20 AM
elihayun's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 388
elihayun is on a distinguished road
Quote:
Originally Posted by intelligent_14
thanks Elihayun, but this function return only one number (a[shift]) i wants it to return all of "a[]" array not a[shift]
U can use it this way


for (int i=0; i<100; i++)
{
double d = MyFunc(i);
<do what u need to do with the return value>
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MT4 Files Functions Replacement. codersguru Tools and utilities 103 04-11-2009 06:52 AM
File Functions intelligent_14 Questions 6 07-11-2006 09:37 PM
Lesson 7 - Functions codersguru Lessons 2 11-02-2005 04:32 PM


All times are GMT. The time now is 01:53 PM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.