Enfusion Script API
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
StaticArray Interface Reference

Static Public Member Functions

static proto void Sort (void paramArray[])
 Sorts static array of integers(ascending) / floats(ascending) / strings(alphabetically) / pointers(by address ascending)
 
static proto void Reverse (void paramArray[])
 Revers order of static array elements.
 
static proto int Copy (void destArray[], void srcArray[], int dstOffset=0, int srcOffset=0, int num=-1)
 Copy elements from one static array into another (of same type)
 
static proto int Length (void paramArray[])
 Return length of static array.
 

Member Function Documentation

◆ Copy()

static proto int StaticArray.Copy ( void  destArray[],
void  srcArray[],
int  dstOffset = 0,
int  srcOffset = 0,
int  num = -1 
)
static

Copy elements from one static array into another (of same type)

Parameters
destArraydestination array
srcArraysource array
dstOffsetelement offset in destination array
srcOffsetelement offset in source array
numnumber of elements to copy (-1 for all of them)
Returns
int number of elements copied
int arr1[3] = {1,2,3};
int arr2[3];
int arr3[2];
// copy all elements from arr1 to arr2
StaticArray.Copy(arr2, arr1);
// copy last two elements from arr1 at the beginning of arr3
StaticArray.Copy(arr3, arr1, 0, 1, 2);
Print(arr1);
Print(arr2);
Print(arr3);
>> {1,2,3}
>> {1,2,3}
>> {2,3}
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
Definition: StaticArray.c:13
static proto int Copy(void destArray[], void srcArray[], int dstOffset=0, int srcOffset=0, int num=-1)
Copy elements from one static array into another (of same type)

◆ Length()

static proto int StaticArray.Length ( void  paramArray[])
static

Return length of static array.

◆ Reverse()

static proto void StaticArray.Reverse ( void  paramArray[])
static

Revers order of static array elements.

int arr1[] = {1,2,3};
Print(arr1);
Print(arr1);
>> {1,2,3}
>> {3,2,1}
static proto void Reverse(void paramArray[])
Revers order of static array elements.

◆ Sort()

static proto void StaticArray.Sort ( void  paramArray[])
static

Sorts static array of integers(ascending) / floats(ascending) / strings(alphabetically) / pointers(by address ascending)

Parameters
paramArrayArray to sort
string arrStr[3] = {"Dog", "Car", "Apple"};
StaticArray.Sort(arrStr);
Print(arrStr);
>> {'Apple','Car','Dog'}
static proto void Sort(void paramArray[])
Sorts static array of integers(ascending) / floats(ascending) / strings(alphabetically) / pointers(by...

The documentation for this interface was generated from the following file: