functions Methods 8

Analyze (source, inputs)
Analysis
CreateScript (source, locals)
Script
Creates a reusable script. Syntax and execution errors are reported through Sandbox.Script.LastError. Binding and IL compilation occur on the first run, once arguments are available. Supply a local store to share persistent fields or preserve them across source edits. If omitted, the script receives its own local store.
CreateStore ()
ScriptStore
Creates an independent store. Share it between scripts belonging to the same owner.
Load (source, filePath)
bool
Executes source in the current state. Matching functions and whole types are replaced; omitted definitions remain. Each call has fresh private locals. The optional filename is used for diagnostics and source navigation. Contexts owning named files, including scanned script resources, must use LoadFiles for edits or CreateScript for temporary commands. Clients receiving the host's scripts must use temporary commands instead of publishing local declarations.
LoadFile (filePath, source)
FileLoadResult
Adds or replaces one named script from source without reading or writing a file, preserving other scripts. The name shares the same namespace as loaded resource paths; a later resource scan can replace it. Hosts replicate .csx names except those ending in .server.csx, including to clients that join later. Unchanged source does not run again. Clients receiving the host's scripts cannot call this method. Publication and startup failures are reported in the result, as with Sandbox.ScriptSystem.LoadFiles(System.Collections.Generic.IReadOnlyDictionary{System.String,System.String}).
LoadFiles (files)
FileLoadResult
RemoveFile (filePath)
FileLoadResult
Removes a named script and its declarations without deleting a file or undoing previous side effects. Hosts replicate shared-script removals. Other scripts retain their state, and a missing name is a no-op. Clients receiving the host's scripts cannot call this method. A later resource scan can restore a disk-backed script. Publication failures are reported in the result, as with Sandbox.ScriptSystem.LoadFiles(System.Collections.Generic.IReadOnlyDictionary{System.String,System.String}).
Run (source)
T
Runs a script using cached code and returns its value. Throws if execution fails, no value is returned, or the return type is incompatible with .
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.