'returns True if ok.
dont_analyze should be used internally ONLY.'

def set_array(self, ad, nb_entries, entry_type, dont_analyze=False):

    if ((entry_type < MEM_BYTE) or (entry_type > MEM_QOFFSET) or (nb_entries <= 0)):
        return False
    entry_size = self.mem.get_size_from_type(entry_type)
    sz = (entry_size * nb_entries)
    s = self.__binary.get_section(ad)
    if ((ad + sz) > (s.end + 1)):
        return False
    if (MEM_WOFFSET <= entry_type <= MEM_QOFFSET):
        end = (ad + sz)
        i = ad
        while (i < end):
            ty = self.mem.get_type(i)
            if (not (MEM_WOFFSET <= ty <= MEM_QOFFSET)):
                self.set_offset(i, self.mem.get_type_from_size(entry_size), dont_analyze=dont_analyze)
            i += entry_size
    elif (not self.__undefine(ad)):
        return False
    self.mem.add(ad, sz, MEM_ARRAY, entry_type)
    return True
