GlobalVariablesTotal

Gibt die gesamte Anzahl der globalen Variablen des Client-Terminals zurück.

int  GlobalVariablesTotal();

Rückgabewert

Anzahl der globalen Variablen.

Hinweis

Globale Variablen existieren im Client-Terminal innerhab von 4 Wochen seit dem letzten Zugriffs, danach werden sie automatisch entfernt. Zugriff zur globalen Variable ist nicht nur die Einstellung des neuen wertes, sondern auch das Lesen des Wertes der globalen Variable.

 

Beispiel:

#property copyright "Copyright 2025, MetaQuotes Ltd."
#property link      "https://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Skript Programm Start Funktion                                   |
//+------------------------------------------------------------------+
void OnStart()
  {
//--- Gesamtzahl der globalen Variablen des Client-Terminals abrufen und im Log ausgeben
   int total=GlobalVariablesTotal();
   Print("Total number of global variables of the client terminal: "total);
   /*
   Ergebnis:
   Total number of global variables of the client terminal20
   */
  }