# Static Functions

As with static variables, Budgie syntax for static functions behaves almost identically to the member equivalents. The only difference is that accessing them takes in the class name instead of an instance reference.

```
class start : Utilities
    static function declare start : public GetLongest string words { array type : string }
        variable : longest string

        for each start : words word string
            if start : { operation : { string length : word } (greater than) { string length : longest } }
                operation : longest equals word
            if end
        for each end

        static function : public Utilities log word

        return : longest
    static function declare end

    static function declare start : public log void word string
        print : { concatenate : ("Logging: ") word }
    static function declare end
class end
```

In C#:

```csharp
using System;

class Utilities
{
    public static string GetLongest(string[] words)
    {
        string longest;

        foreach (string word in words)
        {
            if (word.Length > longest.Length)
            {
                longest = word;
            }
        }

        Utilities.Log(word);

        return longest;
    }

    public static void Log(string word)
    {
        Console.WriteLine("Logging: " + word);
    }
}
```

In Python:

```python
class Utilities:
    @staticmethod
    def get_longest(words):
        for word in words:
            if len(word) > len(longest):
                longest = word

        Utilities.log(word)

        return longest

    @staticmethod
    def log(word):
        print("Logging: " + word)
```


---

# 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.budgielang.org/syntax/classes/static-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.
