Rebol 程式設計/echo
外觀
ECHO target
將控制檯輸出複製到檔案。
ECHO 是一個函式值。
- 目標 -- (型別:檔案 無 邏輯)
- 捕獲
echo: func [
"Copies console output to a file."
[catch]
target [file! none! logic!]
][
if port? system/ports/echo [
close system/ports/echo
system/ports/echo: none
]
if target = true [target: %rebol-echo.txt]
if file? target [
system/ports/echo: throw-on-error [open/write/new/direct target]
]
]