# Question about arrays

**URL:** https://forum.kirupa.com/t/question-about-arrays/136455
**Category:** Uncategorized
**Created:** [February 5, 2005, 12:38am UTC](https://forum.kirupa.com/t/question-about-arrays/136455 "2005-02-05T00:38:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![vernbaby](https://avatars.discourse-cdn.com/v4/letter/v/d9b06d/32.png) [@vernbaby](https://forum.kirupa.com/u/vernbaby)
#### Post date: [February 5, 2005, 12:38am UTC](https://forum.kirupa.com/t/question-about-arrays/136455/1 "2005-02-05T00:38:00Z")

</div>

Hey there…

Quick question… is there a way to check an array to see if an element has already been added? I’m working with an XML document where there are 4 possible variables, but these 4 vars are repeated several times over. It’s reading in fine… I just want to pull those specific variables out of the XML and add them to an array, but I do not want them to duplicate.

To say it another way… I don’t want my array to be more than 4 items long (it is possible to be less) with a max of those 4 different vars.

Any ideas? Suggestions would be greatly appreciated!!
