# Compiler

<div align="left"><figure><img src="/files/dtFAQOlHjSwq58EimYFS" alt=""><figcaption></figcaption></figure></div>

## File Name Format

<div align="left"><figure><img src="/files/ePLwkUmf316AGU0xSuX8" alt=""><figcaption></figcaption></figure></div>

These fields specify the path and name for compiled files using placeholder variables:

* `$dir` – input file directory path
* `$name` – input file name (without extension)
* `$ext` – input file extension

**Example:** Input file: `C:\MyDir\main.txt`

* `$dir` = `C:\MyDir`
* `$name` = `main`
* `$ext` = `.txt`

Using format `$dir\$name.scm` creates output file: `C:\MyDir\main.scm`

## String Case

![](/files/7BkMap64ni3JyEEphWlH)

Compiler will transform [string literals](/language/data-types.md#string-literals) to selected case.

## Options

### Strict IF Validation

The compiler counts and validates number of used conditions in an IF statement. The upper limit is `8`.

### Ranges check

The number of local and global [variables](/language/data-types/variables.md) is [limited](/scm-documentation/gta-limits.md). When this option is checked, the compiler checks if a variable fits the available range.

### Add extra info to SCM

If this option is checked the compiler adds extra information at the end of the resulting file. This info is used later when this file gets disassembled to restore the source closer to the original. The following data is stored:

* [HEX..END](/language/instructions/hex..end.md) constructs offsets
* [global variables](/language/data-types/variables.md#global-variables) names
* full source code (use [$NOSOURCE](/language/directives.md#usdnosource) to disable)
* current [edit mode](/edit-modes.md)

{% hint style="info" %}
Starting from v3.8.0 the disassembler can [ignore extra information](/editor/debug-options.md#skip_extra_info).
{% endhint %}

### Show warning

This option is only used during compilation of the San Andreas scripts. If the game is running, the file `script.img` containing external scripts can't be overwritten as the game uses this file and the compiler complains about it. You may disable the warning by unchecking this box.


---

# Agent Instructions: 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:

```
GET https://docs.sannybuilder.com/editor/options/compiler.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
