Macros are really "methods of editor", and SetCursor etc.. are methods too, that is why you cannot invoke them in global functions. You need to define a method...
.test = @(a, b)
{
SetCursor(0);
if (Find("STD::COUT", 1, 1))
{
f = GetSelBegin();
l = GetSelCount();
SetCursor(f);
Remove(l);
s = a + "::" + b;
Insert(s);
}
};
test(A, B);