forked from e187038/SP_GVA1
39 lines
No EOL
1.9 KiB
MQL5
39 lines
No EOL
1.9 KiB
MQL5
//+------------------------------------------------------------------+
|
|
//| Clase sencilla con dos variables y dos funciones |
|
|
//+------------------------------------------------------------------+
|
|
class MiClase
|
|
{
|
|
private:
|
|
int variable1;
|
|
double variable2;
|
|
|
|
public:
|
|
// Constructor
|
|
MiClase(int valor1, double valor2) : variable1(valor1), variable2(valor2)
|
|
{
|
|
}
|
|
|
|
// Función para establecer el valor de variable1
|
|
void EstablecerVariable1(int nuevoValor)
|
|
{
|
|
variable1 = nuevoValor;
|
|
}
|
|
|
|
// Función para obtener el valor de variable1
|
|
int ObtenerVariable1()
|
|
{
|
|
return variable1+99;
|
|
}
|
|
|
|
// Función para establecer el valor de variable2
|
|
void EstablecerVariable2(double nuevoValor)
|
|
{
|
|
variable2 = nuevoValor;
|
|
}
|
|
|
|
// Función para obtener el valor de variable2
|
|
double ObtenerVariable2()
|
|
{
|
|
return variable2;
|
|
}
|
|
}; |