跳转到内容

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 "^/]^/"
            ]
        ] [#]
    ]
]
华夏公益教科书