environment-variables - How to make local environment same for Do File Editor as for Command/Results (to use tempfiles)
问题描述
How can I make the environment be the same for the Do File editor and the Command/Results?
What I mean is this: if one runs code from the Do File editor that defines a local (local localname localvalue
), then that local is not accessible when typing in the Command
window. How can I make the environment (meaning the environment as it refers to locals) the same for both the Do File editor and the Command window?
The practical reason I want to do this is that I use lots of tempfiles in my code. If I have hundreds or thousands of lines of code written up in the Do File editor, I need to copy and paste all of them into the Command window in order to access the individual tempfiles when testing out individual lines of code in the Command window. This is a bit tedious to have to do over and over.
As an example, suppose that we run this code from the Do File editor:
sysuse auto2, clear
tempfile auto
save `auto'
Then we cannot access auto
from the Command window. Is it possible to change a setting in Stata that will in fact allow us to access auto
?
解决方案
推荐阅读
- python - 改进我对埃拉托色尼筛的实施
- bash - 是否可以为菜单完成定义完成规范?
- python - 使用硒我想刮掉这段文字
- reactjs - 在 componentDidmount 之前调用 ComponentWillUnmount
- docker - 使用 localhost 将 docker-gramex 容器中的 pandas 连接到在主机上运行的数据库
- python - Python Tkinter - 上传文件后启用按钮
- amazon-s3 - 使用 Kafka Connect S3 Sink 时从 S3 路径中删除主题名称
- mongodb - 即使返回错误,带有 mongodb 和 nexus 的 GQL-Prisma 也会写入 db
- firebase - GunDB 存储和超级对等选项
- swift - 如何制作一个从地址swift 4返回坐标的函数