UnrealScript - Functions

Functions

UnrealScript uses functions similar to C/C++. Functions are declared by the keyword: function, the return type: int, the name: example_function, and finally the function parameters enclosed in parenthesis: (int example_number).

The body is enclosed in brackets { example_number = 5; }.

Before the final bracket, a return function can be called, returning the a value to the original caller.

function int example_function (int example_number) { example_number = 5; return example_number; }

This function takes the integer example_number, changes its value to 5, then returns its value to the caller.

Read more about this topic:  UnrealScript

Famous quotes containing the word functions:

    The mind is a finer body, and resumes its functions of feeding, digesting, absorbing, excluding, and generating, in a new and ethereal element. Here, in the brain, is all the process of alimentation repeated, in the acquiring, comparing, digesting, and assimilating of experience. Here again is the mystery of generation repeated.
    Ralph Waldo Emerson (1803–1882)

    In today’s world parents find themselves at the mercy of a society which imposes pressures and priorities that allow neither time nor place for meaningful activities and relations between children and adults, which downgrade the role of parents and the functions of parenthood, and which prevent the parent from doing things he wants to do as a guide, friend, and companion to his children.
    Urie Bronfenbrenner (b. 1917)

    Nobody is so constituted as to be able to live everywhere and anywhere; and he who has great duties to perform, which lay claim to all his strength, has, in this respect, a very limited choice. The influence of climate upon the bodily functions ... extends so far, that a blunder in the choice of locality and climate is able not only to alienate a man from his actual duty, but also to withhold it from him altogether, so that he never even comes face to face with it.
    Friedrich Nietzsche (1844–1900)