Rebol Programming/more

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

USAGE:[edit | edit source]

MORE 'file 

DESCRIPTION:[edit | edit source]

Print file (shell shortcut function).

MORE is a function value.

ARGUMENTS:[edit | edit source]

  • file -- Accepts %file, :variables and just words (as file names) (Type: file word path string paren)

(SPECIAL ATTRIBUTES)[edit | edit source]

  • catch

SOURCE CODE[edit | edit source]

more: func [
    "Print file (shell shortcut function)." 
    'file [file! word! path! string! paren!] {Accepts %file, :variables and just words (as file names)}
    if paren? :file [set/any 'file do :file] 
    print read switch/default type?/word get/any 'file [
        file! [file] 
        string! [to-rebol-file file] 
        word! path! [to-file file]
    ] [throw-error 'script 'expect-arg reduce ['more 'file type? get/any 'file]]