# Type Checking functions

#### For faster and efficient checking of the types of values, SRON provides 7 functions

> * isVoid()
> * isInt()
> * isDouble()
> * isChar()
> * isBool()
> * isCollective()
> * isString()
> * isList()
> * isFileReader()
> * isFileWriter()
> * isLiteralString()

***

### **1. isVoid():**

This function returns true if the passed value is Void otherwise false.

```js
{
    name : Main
    Any val = Void

    if : {
        condition : isVoid(val)
        println("Value is Void")
    }
    else : { 
        println("Value is not Void")
    }
}
```

#### **OUTPUT:**

> Value is Void

***

### **2. isInt():**

This function returns true if the passed value is of type **'Int'** otherwise false.

```js
{
    name : Main
    Any val = 27062003

    if : {
        condition : isInt(val)
        println("Value is an Integer")
    }
    else : { 
        println("Value is not an Integer")
    }
}
```

#### **OUTPUT:**

> Value is an integer

***

### **3. isDouble():**

This function returns true if the passed value is of type **'Double'** otherwise false.

```js
{
    name : Main
    Any val = 2706.2003

    if : {
        condition : isDouble(val)
        println("Value is a decimal number")
    }
    else : { 
        println("Value is not a decimal number")
    }
}
```

#### **OUTPUT:**

> Value is a decimal number

***

### **4. isChar():**

This function returns true if the passed value is of type **'Char'** otherwise false.

```js
{
    name : Main
    Any val = 'S'

    if : {
        condition : isChar(val)
        println("Value is a character")
    }
    else : { 
        println("Value is not a character")
    }
}

```

#### **OUTPUT:**

> Value is a character

***

### **5. isBool():**

This function returns true if the passed value is of type **'Bool'** Void otherwise false.

```js
{
    name : Main
    Any val = false

    if : {
        condition : isBool(val)
        println("Value is a boolean")
    }
    else : { 
        println("Value is not a boolean")
    }
}

```

#### **OUTPUT:**

> Value is a boolean

***

### **6. isCollective():**

This function returns true if the passed value is of type **'List'** or **'String'** otherwise false.

```js
{
    name : Main
    Any val = [1, 2, true, [91, 92]]

    if : {
        condition : isCollective(val)
        println("Value is of collective type")
    }
    else : { 
        println("Value is not of collective type")
    }
}
```

#### **OUTPUT:**

> Value is of collective type

***

### **7. isString():**

This function returns true if the passed value is of type **'String'** otherwise false.

```js
{
    name : Main
    String val = "SRON"

    if : {
        condition : isString(val)
        println("Value is a string")
    }
    else : { 
        println("Value is not a string")
    }
}

```

#### **OUTPUT:**

> Value is a string

***

### **8. isList():**

This function returns true if the passed value is of type **'List'** otherwise false.

```js
{
    name : Main
    Any val = [1,2,3,4.177]

    if : {
        condition : isList(val)
        println("Value is a list")
    }
    else : { 
        println("Value is not a list")
    }
}

```

#### **OUTPUT:**

> Value is a list

***

### **9. isFileReader():**

This function returns true if the passed value is of type **'FileReader'** otherwise false.

```js
{
    name : Main
    Any val = freader("file.txt")

    if : {
        condition : isFileReader(val)
        println("Value is a file reader")
    }
    else : { 
        println("Value is not a file reader")
    }
}

```

#### **OUTPUT:**

> Value is a file reader

***

### **10. isFileWriter():**

This function returns true if the passed value is of type **'FileWriter'** otherwise false.

```js
{
    name : Main
    Any val = fwriter("file.txt", true)

    if : {
        condition : isFileWriter(val)
        println("Value is a file writer")
    }
    else : { 
        println("Value is not a file writer")
    }
}

```

#### **OUTPUT:**

> Value is a file writer

***

### **11. isLiteralString():**

This function returns true if the passed value is of type **'LiteralString'** otherwise false.

```js
{
    name : Main
    Any val = "Hi! SRON"

    if : {
        condition : isLiteralString(val)
        println("Value is a LiteralString")
    }
    else : { 
        println("Value is not a LiteralString")
    }
}

```

#### **OUTPUT:**

> Value is a LiteralString

***


---

# 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://sron.gitbook.io/docs/functions-in-sron/type-checking-functions.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.
