I have declared a local variable inside my function. And whenever I reference it for a mathematical operation, it gives me the error 'invalid name'. A snippet of the code is given below:
Code:
cap program drop ix program ix, rclass version 15.1 syntax varlist(numeric min=1 max=1), ix(string) local y `:word 1 of `varlist'' sum `y' . . . tempname nt matrix nt = `ix' gen v = y:*nt . . . //return lists end
Note: The variable y has content, it is not 0. The matrix from ix and y have dimensions that allow the :* operation. nt is not empty.
Where am I going wrong?
0 Response to .ado Programming in Stata without invoking mata: Invalid Name error from within the function
Post a Comment