Script?

angerangel edited this page Jan 7, 2013 · 1 revision
Clone this wiki locally

USAGE

   SCRIPT? source

DESCRIPTION

Checks file, url, or string for a valid script header.

SCRIPT? is a function value.

ARGUMENTS

  • source (file! url! binary! string!)

#SOURCE

script?: make function! [  [
    {Checks file, url, or string for a valid script header.}
    source [file! url! binary! string!]
][
    switch type?/word source [
        file! url! [source: read source]
        string! [source: to binary! source]
    ]
    find-script source
] ]