Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • file handle texfile not found

    HI all,

    I'm running a code from someone else. I got the error in the title when running the following code:
    Code:
    local controls var1 var2 var3
    
    * Loop through control variables
    foreach var of local controls{
        file open texfile using "`var'_iv_table.tex", write replace
    }
    But when I run file open texfile separately without being in a loop (e.g.
    Code:
    file open texfile using "var1_iv_table.tex", write replace
    ), it runs properly. Do you know how I can resolve the error encountered in the loop?
    Thank you!

  • #2
    You should probably use a different file handle for each file in the loop, say something like tex_`var' instead of texfile. Even better might be to use tempnames. See help file.

    Comment

    Working...
    X