Rebol Programming/save-user

From Wikibooks, open books for an open world
< Rebol Programming
Jump to navigation Jump to search

USAGE:[edit | edit source]


DESCRIPTION:[edit | edit source]

Save user.r, prompting for overwrite permission

SAVE-USER is a function value.

SOURCE CODE[edit | edit source]

save-user: func [
    "Save user.r, prompting for overwrite permission" 
    /local user.r
    user.r: either view? [view-root/user.r] [system/options/home/user.r] 
    if any [
        not exists? user.r 
        confirm "^/Overwrite the current user.r file? "
    ] [
        print {
Creating user.r file in the REBOL home directory.
        print trim {
^-^-^-To change these settings, type "set-user" at the
^-^-^-prompt or edit your user.r file.