#property copyright "Copyright 2025, MetaQuotes Ltd."
#property link "https://www.mql5.com"
#property version "1.00"
#define GV_NAME "TestGlobalVariableDel"
//+------------------------------------------------------------------+
//| スクリプトプログラム開始関数 |
//+------------------------------------------------------------------+
void OnStart()
{
//--- クライアント端末のグローバル変数GV_NAMEが存在するかどうかを確認する
if(!GlobalVariableCheck(GV_NAME))
{
PrintFormat("Terminal global variable named \"%s\" does not exist", GV_NAME);
return;
}
//--- クライアント端末のグローバル変数GV_NAMEを削除する
if(!GlobalVariableDel(GV_NAME))
{
Print("GlobalVariableDel() failed. Error ",GetLastError());
return;
}
//--- クライアント端末のグローバル変数GV_NAMEの削除が成功したかどうかを確認する
if(!GlobalVariableCheck(GV_NAME))
{
PrintFormat("The terminal global variable named \"%s\" was successfully deleted", GV_NAME);
}
/*
result in case of the absence of the client terminal global variable with the name GV_NAME
Terminal global variable named "TestGlobalVariableDel" does not exist
result in case of the presence of the client terminal global variable with the name GV_NAME
The terminal global variable named "TestGlobalVariableDel" was successfully deleted
*/
}
|