typemismatch on dynamic array

Discussions about Coding and Scripting
Post Reply
Bloeb
Experienced
Posts: 95
Joined: Tue Apr 06, 2010 11:07 am

typemismatch on dynamic array

Post by Bloeb »

I'm trying to get the length of a dynamic array. I thought this would be straightforward, but I'm getting a type-mismatch-error.

code:

Code: Select all

local array<int> MyArray;
local int MyLength;
MyLength = MyArray.Length;
error:

Code: Select all

Error, Array mismatch in '='
Bloeb
Experienced
Posts: 95
Joined: Tue Apr 06, 2010 11:07 am

Re: typemismatch on dynamic array

Post by Bloeb »

hmzz, I'm just reading here that Dynamic Arrays are basicly useless in Unreal Engine 1. :S
User avatar
anth
Adept
Posts: 257
Joined: Thu May 13, 2010 2:23 am

Re: typemismatch on dynamic array

Post by anth »

Dynamic arrays were never finished in UEngine 1.0 (although most of the internal code is there, including compiler support). It's best to stick to static arrays if you don't want to code anything native. If you absolutely need dynamic behaviour you could try and use linked lists. (or even a hybrid approach with static arrays linked together).
Bloeb
Experienced
Posts: 95
Joined: Tue Apr 06, 2010 11:07 am

Re: typemismatch on dynamic array

Post by Bloeb »

Hehe, a linked list isn't going to work. I wanted to have a dynamic-array-property. A linked list can't simulate that behaviour. Therefore I'm left with static arrays.
Post Reply