I have what I thought was defensive code on getting a global variable. Can anyone explain why I got an error 4058 ?
if (GlobalVariableCheck(GVQualify + "BadTrendLock") == True)
BadTrendLock = GlobalVariableGet(GVQualify + "BadTrendLock");
file_err = GetLastError();
if (BadTrendLock == 0 && file_err != 0)
Print("Error - ",file_err, " Getting Global Variable GVQualify-BadTrendLock (010)");
BadTrendLock = True;
GlobalVariableSet(GVQualify + "BadTrendLock",1);
From the Log :
Error - 4058 Getting Global Variable GVQualify-BadTrendLock (010)
#define ERR_GLOBAL_VARIABLE_NOT_FOUND 4058
Create a string variable and put the global variable name inside. Use that instead of repeated string concats.
Also, print that variable to make sure that GVQualify has the correct value.