MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / VarUnsetError

Method VarUnsetError

source/script.cpp:13381–13392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13379
13380
13381ResultType Script::VarUnsetError(Var *var)
13382{
13383 bool isUndeclaredLocal = (var->Scope() & (VAR_LOCAL | VAR_DECLARED)) == VAR_LOCAL;
13384 TCHAR buf[DIALOG_TITLE_SIZE];
13385 if (var->Scope() != 0) // Avoid showing "Specifically: global " for temporary VarRefs of unspecified scope, such as those used by Array::FromEnumerable or the debugger.
13386 {
13387 LPCTSTR sameNameAsGlobal = isUndeclaredLocal && FindGlobalVar(var->mName) ? _T(" (same name as a global)") : _T("");
13388 sntprintf(buf, _countof(buf), _T("%s %s%s"), Var::DeclarationType(var->Scope()), var->mName, sameNameAsGlobal);
13389 }
13390 else *buf = '\0';
13391 return RuntimeError(ERR_VAR_UNSET, buf);
13392}
13393
13394
13395

Callers 3

ExpandExpressionMethod · 0.80
ExpandArgsMethod · 0.80
PerformAssignMethod · 0.80

Calls 1

sntprintfFunction · 0.85

Tested by

no test coverage detected