Table of Contents

Method Load

Namespace
OpenCAD2D.Lisp
Assembly
OpenCAD2D.Core.dll

Load(string, object)

Loads a file as (load path) does: a rooted name is that file, any other (a bare name, or one with a relative folder such as Sub/x or ./x.lsp) is looked for in the SupportFolders in order, and .lsp is added to a name with no extension. The forms are read and evaluated one at a time, so an error leaves what ran before it.

public LispResult Load(string path, object onFailure = null)

Parameters

path string

The file name as the program writes it.

onFailure object

What to return when the file is not found; null for none, which makes it an error: LOAD failed: "name".

Returns

LispResult

The value of the last form in the file, and what the forms wrote; the value is not written after it, as (load) typed at the command line writes it, since the caller (APPLOAD, the startup files) writes its own line. A .fas or .vlx file is refused.

Exceptions

ArgumentNullException

Thrown when the path is null.