跳轉到內容

Rebol 程式設計/write-user

來自華夏公益教科書,開放的書籍,為開放的世界
WRITE-USER 

將網路配置寫入 user.r 檔案

WRITE-USER 是一個函式值。

原始碼

[編輯 | 編輯原始碼]
write-user: func [
    "Write network config to user.r file" 
    /local user.r
][
    user.r: either view? [view-root/user.r] [system/options/home/user.r] 
    write user.r trim reform [{
^-^-REBOL [
^-^-^-Title: "User Preferences"
^-^-^-Date: } now {
^-^-]

^-^-set-net [} 
        system/user/email 
        system/schemes/default/host 
        system/schemes/pop/host 
        system/schemes/default/proxy/host 
        system/schemes/default/proxy/port-id 
        system/schemes/default/proxy/type 
        "]^/^-^-" either found? system/user/name [
            reform ["set-user-name" mold system/user/name newline]
        ] [#] 
        either view? [
            reform [{if (not none? system/view) [
^-system/view/screen-face/options:} 
                mold system/view/screen-face/options "^/]^/"
            ]
        ] [#]
    ]
]
華夏公益教科書