Hi Statalist,
I am trying to write a command with the following syntax: varname =/ exp. I'm getting the error below when exp is a string. It seems that the syntax check tests if the input is either a number of a numeric variable. However, there's nothing in the documentation stating that exp should be numeric, and the most immediate example of a command with this syntax, gen, obviously accepts strings and string variables as input.
Here is one example:
This command
Gives me these results:
Has anyone had this issue before or knows where I can find documentation on this option?
Thanks a lot!
Luiza
I am trying to write a command with the following syntax: varname =/ exp. I'm getting the error below when exp is a string. It seems that the syntax check tests if the input is either a number of a numeric variable. However, there's nothing in the documentation stating that exp should be numeric, and the most immediate example of a command with this syntax, gen, obviously accepts strings and string variables as input.
Here is one example:
This command
Code:
capture program drop testexp program testexp syntax anything =/ exp noi di `" `exp' "' end
. * Using a number
. testexp exp = 1
1
. * Using a numeric variable
. testexp exp = key
key
. testexp exp = ln(key)
ln(key)
. * Using a variable that does not exist
. testexp exp = foo
foo not found
r(111);
. * Using a string
. testexp exp = "foo"
type mismatch
r(109);
Thanks a lot!
Luiza
Comment