GlobalVariablesTotal

클라이언트 터미널의 총 글로벌 변수 수를 반환.

int  GlobalVariablesTotal();

값 반환

글로벌 변수의 수.

주의

글로벌 변수는 마지막 사용 후 4주 동안 클라이언트 터미널에 존재하면 자동으로 삭제됩니다. 글로벌 변수를 호출하면 새 값을 설정할 뿐만 아니라 글로벌 변수의 값을 읽을 수도 있습니다.

 

예:

#property copyright "Copyright 2025, MetaQuotes Ltd."
#property link      "https://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| 스크립트 프로그램 시작 함수                                                |
//+------------------------------------------------------------------+
void OnStart()
  {
//--- 클라이언트 터미널의 전역 변수 총 개수를 가져오고 기록합니다
   int total=GlobalVariablesTotal();
   Print("Total number of global variables of the client terminal: "total);
   /*
   결과:
   Total number of global variables of the client terminal20
   */
  }