I'm currently writing a program that functions as a wrapper for gen. It gets a type mismatch error (r109) when a string is used in the =exp that's passed to gen. This problem can be reproduced at least in Versions 12 - 14.2 by using the following program:
The trace of the error indicates that it happens in the syntax line, when the program receives the string in the =exp:
Is there any way for Stata to allow a string in the =exp? Is there a way around this problem that still allows anything in the syntax line?
Code:
program define dia syntax anything =exp di "`anything'" end dia a = "1"
Code:
dia a = "1" --------------------------------------------------------------------------------------------- begin dia --- - syntax anything =exp type mismatch ----------------------------------------------------------------------------------------------- end dia ---
Comment