Hello, is it possible to return two values from a function in mql4 programming?
required to function call function 2 replies
Generic Script to return indicator Buffer values 7 replies
iCustom(...) return values don't match contents of the Data window in MT4... 3 replies
stop loss function and edit time function for Breakout EA 1 reply
Calculating Function values for higher TFs, Programming help 6 replies
DislikedHello, is it possible to return two values from a function in mql4 programming?Ignored
start(){
PassByReferenceTest(1, 2, 3);
Print(outArray[0]," ",outArray[1]);
// error variable outArray not defined
PassByReferenceTest(1, 2, 3);
Print(PassByReferenceTest(1, 2, 3)," ",PassByReferenceTest(1, 2, 3));
// error incompatibel types
PassByReferenceTest(&1, &2, &3);
Print(outArray[0]," ",outArray[1]);
// error variable outArray not defined
}
//-------
void PassByReferenceTest(int &out1, int &out2, int &outArray[])
{
out1 = 1;
out2 = 2;
outArray[0] = 3;
outArray[1] = 4;
}
start()
{
int xxx[2];
int yyy;
int zzz;
PassByReferenceTest( yyy, zzz, xxx );
...
}
start(){
int out1;
int out2;
int outArray[3];
PassByReferenceTest(1, 2, 3);
// error incompatible types
}
//---------------++
void PassByReferenceTest(int &out1, int &out2, int &outArray[])
{
out1 = 1;
out2 = 2;
outArray[0] = 3;
outArray[1] = 4;
}
PassByReferenceTest(out1, out2, outArray);