> For the complete documentation index, see [llms.txt](https://desktop-api.iceteagroup.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://desktop-api.iceteagroup.com/ppj.runtime.xsal.49/general/ppj.runtime.xsal.xsalscript.md).

# XSalScript

Namespace: **PPJ.Runtime.XSal**

Assembly: **PPJ.Runtime.XSal.49** (4.9.0.0)

Implementation of XSalScript

{% tabs %}
{% tab title="C#" %}

```csharp
public class XSalScript
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class XSalScript
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](/files/dBIrS7XBDGmrzmTRbSI6)XSalScript()

Constructs a new empty XSalScript object.

### ![](/files/dBIrS7XBDGmrzmTRbSI6)XSalScript(source)

Constructs a new XSalScript object and compiles the specified source code.

| Name       | Type                                                                | Description |
| ---------- | ------------------------------------------------------------------- | ----------- |
| **source** | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) |             |

## Properties

### ![](/files/dBIrS7XBDGmrzmTRbSI6)Context

[Object](https://docs.microsoft.com/en-us/dotnet/api/system.object): Returns/Sets the context for the execution of the script.

### ![](/files/dBIrS7XBDGmrzmTRbSI6)CSharpSyntax

[Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean): Returns/Sets the C# flag to turn on the preprocessor. When this property is false, the preprocessor tries to adapt old XSalScript syntax to C# syntax.

### ![](/files/dBIrS7XBDGmrzmTRbSI6)DebugMode

[Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean): Returns/Sets the debug mode. When on the script will pop up the error message box.

### ![](/files/dBIrS7XBDGmrzmTRbSI6)Handle

[IntPtr](https://docs.microsoft.com/en-us/dotnet/api/system.intptr): Handle

### ![](/files/dBIrS7XBDGmrzmTRbSI6)HasErrors

[Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean): Returns true if the script object contains a list of errors.

### ![](/files/69uzLyEV3ANF4GK6pznb)Interpreter

[ScriptEngine](/ppj.runtime.xsal.49/general/ppj.runtime.xsal.xsalscript.md): Returns the instance of the interpreter used by XSalScript.

### ![](/files/dBIrS7XBDGmrzmTRbSI6)LastError

[String](https://docs.microsoft.com/en-us/dotnet/api/system.string): Returns the last error message.

### ![](/files/dBIrS7XBDGmrzmTRbSI6)Source

[String](https://docs.microsoft.com/en-us/dotnet/api/system.string): Returns/Sets the script source code.

## Methods

### ![](/files/dBIrS7XBDGmrzmTRbSI6)AddLine(line)

Adds a line to the script.

| Parameter | Type                                                                | Description |
| --------- | ------------------------------------------------------------------- | ----------- |
| **line**  | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) |             |

**Returns:** [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean).

### ![](/files/dBIrS7XBDGmrzmTRbSI6)Dispose()

Dispose XSalScript

### ![](/files/69uzLyEV3ANF4GK6pznb)FromHandle(handle)

create from Handle

| Parameter  | Type                                                                | Description |
| ---------- | ------------------------------------------------------------------- | ----------- |
| **handle** | [IntPtr](https://docs.microsoft.com/en-us/dotnet/api/system.intptr) |             |

**Returns:** [XSalScript](/ppj.runtime.xsal.49/general/ppj.runtime.xsal.xsalscript.md).

### ![](/files/dBIrS7XBDGmrzmTRbSI6)Run()

Executes the compiled script and returns the return value.

**Returns:** [String](https://docs.microsoft.com/en-us/dotnet/api/system.string).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://desktop-api.iceteagroup.com/ppj.runtime.xsal.49/general/ppj.runtime.xsal.xsalscript.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
