February 16, 2025, 08:52:35 PM
Welcome,
Guest
Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
IRC channel - server:
waelisch.de
channel:
#wme
(
read more
)
Home
Help
Search
Calendar
Login
Register
Wintermute Engine Forum
>
Wintermute Engine
>
Technical forum
>
Topic:
How to empty an array
« previous
next »
Pages: [
1
]
Print
Author
Topic: How to empty an array (Read 7106 times)
0 Members and 1 Guest are viewing this topic.
Dan Peach
Regular poster
Karma: 4
Offline
Posts: 100
How to empty an array
«
on:
May 06, 2016, 10:09:27 PM »
Hello
I have an array that I use to pass some information to a method. Once the method has done, I want to empty the array so that I can use it again. How to empty it?
Thanks.
Dan.
Logged
www.coldwinterwaiting.com
www.viperante.com
anarchist
Regular poster
Karma: 5
Offline
Gender:
Posts: 212
Re: How to empty an array
«
Reply #1 on:
May 06, 2016, 11:27:11 PM »
Hi Dan. You can simply reassign the variable it a new array:
Code: WME Script
arrayVariable =
new
Array
(
)
;
or you can set Lenght to 0 (I haven't tested this, it's according to the documentation):
Code: WME Script
arrayVariable.
Length
=
0
;
Logged
Dan Peach
Regular poster
Karma: 4
Offline
Posts: 100
Re: How to empty an array
«
Reply #2 on:
May 07, 2016, 12:39:44 AM »
Thank you. The second one worked.
Logged
www.coldwinterwaiting.com
www.viperante.com
piere
Supporter
Frequent poster
Karma: 4
Offline
Posts: 302
Sorry for any bad english in my posts. Game on !
Re: How to empty an array
«
Reply #3 on:
May 19, 2016, 02:32:26 AM »
Would arrayVariable.Length = null; work also ?
Logged
Print
Pages: [
1
]
« previous
next »
Wintermute Engine Forum
>
Wintermute Engine
>
Technical forum
>
Topic:
How to empty an array