Monday, December 27, 2021

Suspected bug in -confirm-

The title is self-explanatory. Here is a reproducible example:

Code:
clear
sysuse auto
confirm variable , exact
There is no error where I think there should be one.

I think the above should be equivalent to

Code:
clear
sysuse auto
confirm variable
but it is not.

In case you are wondering, this is relevant in situations where you pass to confirm a local macro that might contain a variable name (or a variable list) but might also be empty. Something like

Code:
confirm `could_be_a_varname_or_empty' , exact
I am (still) using Stata 16.1 fully updated on Windows 11.


Edit:

Here is my workaround that I would like to share:

Code:
novarabbrev confirm variable ...

No comments:

Post a Comment