Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///ds_list_count(list,value)
- /*
- Returns the amount of times the provided value is inside a list
- */
- //Import all passthroughs
- var List = argument0; //The list to check
- var CheckVal = argument1; //The entry we're counting
- var Count = 0; //How many times it appears (0 by default)
- var i = 0; //Current loop position in the list
- //Check every entry in the entire list
- repeat ds_list_size(List)
- {
- //Find an entry in the list
- var Entry = ds_list_find_value(List,i);
- //Is it the same as the one we're looking for?
- if string(Entry) == string(CheckVal)
- {
- //Yes, increase count
- Count++;
- }
- //Move to next position
- i++
- }
- //Return findings
- return Count
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement