Hello Statalisters,
I'm trying to understand better how the -capture- command works because I will have to work with colleagues on a university assignment and I would like to make it easier for everyone. I currently tried something on a do-file and I know where the code is wrong, but sadly I do not know how to fix this issue. Let's suppose we're 3, and we all have access to a common Dropbox. I created 3 macros with the same name (dropbox), each storing our different paths to the Dropbox. Now, I thought that the -capture- command would only store my own path but then I realized that Stata has no way to know which path belongs to who!
Code:
Expectedly, I'm Person 1 and Stata answers me that it couldn't find the file of Person 3, because I understood that everytime I create a new global macro named dropbox, the previous one is erased. Rather than only selecting the first line of the do file, and then selecting the rest of the code to run it, I'd like the dofile to run smoothly and the same way for everyone. I'm sure there is a way to do it but I can't seem to find it after many attempts. Can anyone help me better understanding how the capture command works?
Regards,
Hugo
I'm trying to understand better how the -capture- command works because I will have to work with colleagues on a university assignment and I would like to make it easier for everyone. I currently tried something on a do-file and I know where the code is wrong, but sadly I do not know how to fix this issue. Let's suppose we're 3, and we all have access to a common Dropbox. I created 3 macros with the same name (dropbox), each storing our different paths to the Dropbox. Now, I thought that the -capture- command would only store my own path but then I realized that Stata has no way to know which path belongs to who!
Code:
Code:
capture global dropbox "C:/Users/Person1/..." capture global dropbox "C:/Users/Person2/..." capture global dropbox "C:/Users/Person3/..." cd "$path" use "$path/file.dta", clear
Regards,
Hugo
Comment