Hi,
I would like to know whether a variable exists or not. I am currently using the following code:
However, with the code above, even if q1_e does not exist but q1_e_other does, it will display "q1_e exists" while I should be getting "q1_e does not exist". How can I change my code to display the correct message?
Thank you
I would like to know whether a variable exists or not. I am currently using the following code:
Code:
foreach var of varlist q1 q2 q3 { capture confirm variable `var'_e if !_rc { display "`var'_e exists" } else { display "`var'_e does not exist } }
Thank you
Comment