Hi, Please can someone tell me why the float and double results aren't being printed? Am I missing something obvious? The values don't seem to be returned from the function correctly. My EA has not worked since the upgrade on Saturday and I think this is the cause..
int GetInteger(int option);
float GetFloat(int option);
double GetDouble(int option);
int TestProg::GetInteger(int option) {
switch(option) {
case 1: return 1;
case 2: return 2;
case 3: return 3;
default: return 0;
}
}
float TestProg::GetFloat(int option) {
switch(option) {
case 1: return 1;
case 2: return 2;
case 3: return 3;
default: return 0;
}
}
double TestProg::GetDouble(int option) {
switch(option) {
case 1: return 1;
case 2: return 2;
case 3: return 3;
default: return 0;
}
}
Print(GetInteger(1));
Print(GetInteger(2));
Print(GetInteger(3));
Print(GetFloat(1));
Print(GetFloat(2));
Print(GetFloat(3));
Print(GetDouble(1));
Print(GetDouble(2));
Print(GetDouble(3));
NE 0 TestProg (GBPUSD,H1) 16:54:38 2011.01.07 00:00:00 1
IM 0 TestProg (GBPUSD,H1) 16:54:38 2011.01.07 00:00:00 2
HE 0 TestProg (GBPUSD,H1) 16:54:38 2011.01.07 00:00:00 3
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hi, Please can someone tell me why the float and double results aren't being printed? Am I missing something obvious? The values don't seem to be returned from the function correctly. My EA has not worked since the upgrade on Saturday and I think this is the cause..
int GetInteger(int option);
float GetFloat(int option);
double GetDouble(int option);
int TestProg::GetInteger(int option) {
switch(option) {
case 1: return 1;
case 2: return 2;
case 3: return 3;
default: return 0;
}
}
float TestProg::GetFloat(int option) {
switch(option) {
case 1: return 1;
case 2: return 2;
case 3: return 3;
default: return 0;
}
}
double TestProg::GetDouble(int option) {
switch(option) {
case 1: return 1;
case 2: return 2;
case 3: return 3;
default: return 0;
}
}
Print(GetInteger(1));
Print(GetInteger(2));
Print(GetInteger(3));
Print(GetFloat(1));
Print(GetFloat(2));
Print(GetFloat(3));
Print(GetDouble(1));
Print(GetDouble(2));
Print(GetDouble(3));
NE 0 TestProg (GBPUSD,H1) 16:54:38 2011.01.07 00:00:00 1
IM 0 TestProg (GBPUSD,H1) 16:54:38 2011.01.07 00:00:00 2
HE 0 TestProg (GBPUSD,H1) 16:54:38 2011.01.07 00:00:00 3
QL 0 TestProg (GBPUSD,H1) 16:54:38 2011.01.07 00:00:00 0.0
CG 0 TestProg (GBPUSD,H1) 16:54:38 2011.01.07 00:00:00 0.0
MO 0 TestProg (GBPUSD,H1) 16:54:38 2011.01.07 00:00:00 0.0
FH 0 TestProg (GBPUSD,H1) 16:54:38 2011.01.07 00:00:00 2.868201517097595e-316
QO 0 TestProg (GBPUSD,H1) 16:54:38 2011.01.07 00:00:00 2.868204926150551e-316
RR 0 TestProg (GBPUSD,H1) 16:54:38 2011.01.07 00:00:00 2.868208335203508e-316
Thanks