Importing other files:

To allow organization and minimize bloat of individual scripts, Paisley does allow importing of other scripts with the require keyword. You can even import multiple files in the same statement.

#Import ./file1.pai or ./file1.paisley
require file1

#Import:
# ./file2.pai
# ./path/to/file3.pai
# ./"filename with spaces".pai
require file2 path.to.file3 "filename with spaces"

#Import ../file4.pai
require ..file4

#Import ../../file5.pai
require ...file5

See how it’s possible to import files from N levels above, by prepending N+1 periods to the beginning of a path name.

Note that files can only be imported once, that is, any redundant imports are ignored.

Other statements:


< Prev | Home | Next >