• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Function Idea

Status
Not open for further replies.

CTM

CTM

Level 2
Joined
Nov 6, 2004
Messages
7
Hi,

I've been using JASS for bits of scripts from time to time but I mostly program in PHP. I was wondering if anyone would mind doing a in_array() function like the PHP one...it'd be really helpful :)

Reference for the PHP function : http://www.php.net/manual/en/function.in-array.php

Thanks to anyone who tries to do this :D
 
Level 3
Joined
Mar 27, 2004
Messages
70
It can't really be done since functions can't take arrays as parameters.
However, there are a couple of "object" array systems out there that uses an integer as identifier and the gamecache to store the data in the array.
When I need a dynamic array I use the list utility (found here).
Instead of an in_array function I made a ListFind function which covers the use of an in_array function.
 

CTM

CTM

Level 2
Joined
Nov 6, 2004
Messages
7
Thanks Kat :)

It does seem kinda big just this little part ( no, I didn't add the WP system, I'm not that stupid :p ). But it works and it's optimized, so who cares :p


Thanks again :D

( God I wish we could just edit the C++ )
 
Status
Not open for further replies.
Top