Calling it example:
GlobalVariable kMyGlobal = ReturnHighestGlobal(kArray)
The function:
GlobalVariable Function ReturnHighestGlobal(GlobalVariable[] akGlobalArray) Int iElement = akGlobalArray.Length Int HighestValue = http://forums.bethsoft.com/topic/1499497-resource-returnhighestglobal/0 GlobalVariable HighestGlobal While iElement iElement -= 1 Int iGlobalValue = (akGlobalArray[iElement]).GetValue() as Int if iGlobalValue> HighestValue HighestValue = http://forums.bethsoft.com/topic/1499497-resource-returnhighestglobal/iGlobalValue HighestGlobal = akGlobalArray[iElement] endif EndWhile if HighestValue == 0 Return none endif if HighestGlobal == none Return none endif Return HighestGlobalEndFunction