Rebol 编程/in-dir
外观
< Rebol 编程
IN-DIR dir block
在某个目录中执行代码块。
IN-DIR 是一个函数值。
- dir -- 要更改到的目录(之后会更改回来)(类型:文件)
- block -- 要执行的代码块(类型:代码块)
- 抛出
in-dir: func [ "Evaluate a block while in a directory." [throw] dir [file!] "Directory to change to (changed back after)" block [block!] "Block to evaluate" /local old-dir ][ old-dir: what-dir change-dir dir also do block change-dir old-dir ]