Help me code mql4 New comment Nguyen Dang Giang 2018.03.01 08:13 I want to create a function similar to: void Print( argument, // first value ... // next values ); or uint FileWrite( int file_handle, // File handle ... // List of recorded parameters ); Example function: bool checkCharacters(argument){if(argument=="a") return(true);if(argument=="a" && argument=="b") return(true);if(argument=="a" && argument=="b" && argument=="c") return(true);if(argument=="a" && argument=="b" && argument=="c" && argument=="d")r eturn(true);if(argument=="a" && argument=="d") return(true);return(false);}}Call function: checkCharacters("a","d"); // result truecheckCharacters("a","a"); // result truecheckCharacters("a","b","z"); // result falseThanks everyone! Passing bool variables to .DLL code does not work properly Discussion of article "Statistical Distributions in MQL5 - taking the best of R" OrderClose what im doing wrong? Beginner William Roeder 2018.03.01 14:31 #1 Nguyen Dang Giang: I want to create a function similar to:Variable arguments can't be done. Variable types can't be done.Try default argumentsbool checkCharacters(string a, string b="", string c="", string d="")Or put the arguments in an array and pass that. Nguyen Dang Giang 2018.03.01 14:56 #2 whroeder1: Variable arguments can't be done. Variable types can't be done.Try default argumentsOr put the arguments in an array and pass that.I want a dynamic parameter like the function Print().Thanks whroeder1. New comment
I want to create a function similar to:
void Print(
argument, // first value
... // next values
);
or
uint FileWrite(
int file_handle, // File handle
... // List of recorded parameters
);
Example function:
bool checkCharacters(argument)
{
}
Call function:
checkCharacters("a","d"); // result true
checkCharacters("a","a"); // result true
checkCharacters("a","b","z"); // result false
Thanks everyone!