How to test that an array is 'indexed' vs 'associative'



I have a class constructor that accepts an array as the only argument. The
catch is that the array MUST be an 'integer-indexed' array, not an
'associative' array, because the index position has meaning.

How can I test for this in the constructor without having to traverse the
entire array and checking to make sure the keys are numeric and sequential?

Daniel Klein
Cuyahoga Falls, OH
.



Relevant Pages

  • Re: initializing an array member of a class
    ... >> I want the class constructor to initialize all elements of arr to zero. ... using it as an array of small fixed compile-time-known size. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: comparing some but not all fields in lists
    ... and what's in common." ... I should compare only 3 of the 82 fields in each list. ... comparing all 82 fields as a single array element. ... cannot handle multiple keys as you want it to. ...
    (perl.beginners)
  • Re: Build an array from a text file
    ... Now that I have created my array, ... The dictionary object has a 'keys' method that returns a 0 based array ... Dim vArray As Variant ... dictionaries, so any help would be great! ...
    (microsoft.public.word.vba.general)
  • Re: Nugget - Using control references
    ... until someone decides they want to save a 3D array. ... If the users are likely to add elements to the middle of the enum, you should save and load by the enum text. ... What you can try is this - save both the string and the number. ... Unused keys are not deleted.  When the number of elements in an array is reduced, the key entries still exist in the file. ...
    (comp.lang.labview)
  • Re: hash sortieren nach werten, hash in =?ISO-8859-15?Q?popupmen?= =?ISO-8859-15?Q?=
    ... Dieses Array gibst Du bei -values an. ... Du schreibst Dir eine Funktion, die Dir die Keys ... des Hashes in der Sortierung der Werte liefert. ... values ist eine Referenz auf ein @rray, ...
    (de.comp.lang.perl.cgi)