(self, name, index)
return dimensions, lst
Check if an array has been allocated.
        If not, auto-allocate if indices are <= 10; raise error otherwise.
Check if an array has been allocated.
        If not, auto-allocate if indices are <= 10; raise error otherwise.
Check if an array has been allocated . If not auto - allocate if indices are < = 10 ; raise error otherwise .
def check_dim(self, name, index):
        """
        Check if an array has been allocated.
        If not, auto-allocate if indices are <= 10; raise error otherwise.
        """
        try:
            dimensions = self._dims[name]
        except KeyError:
            # auto-dimension - 0..10 or 1..10
            # this even fixes the dimensions if the index turns out to be out of range
            dimensions = [10] * len(index)
            self.allocate(name, dimensions)
        lst = self._buffers[name]
        if len(index) != len(dimensions):
            raise error.BASICError(error.SUBSCRIPT_OUT_OF_RANGE)
        for i, d in zip(index, dimensions):
            if i < 0:
                raise error.BASICError(error.IFC)
            elif i < self._base or i > d:
                # dimensions is the *maximum index number*, regardless of self._base
                raise error.BASICError(error.SUBSCRIPT_OUT_OF_RANGE)
        return dimensions, lst
def check_dim ( self , name , index ) : try : dimensions = self . _dims [ name ] except KeyError : # auto-dimension - 0..10 or 1..10 # this even fixes the dimensions if the index turns out to be out of range dimensions = [ 10 ] * len ( index ) self . allocate ( name , dimensions ) lst = self . _buffers [ name ] if len ( index ) != len ( dimensions ) : raise error . BASICError ( error . SUBSCRIPT_OUT_OF_RANGE ) for i , d in zip ( index , dimensions ) : if i < 0 : raise error . BASICError ( error . IFC ) elif i < self . _base or i > d : # dimensions is the *maximum index number*, regardless of self._base raise error . BASICError ( error . SUBSCRIPT_OUT_OF_RANGE ) return dimensions , lst