(name, offset)
Memory representation of variable name.
Memory representation of variable name.
Memory representation of variable name .
def get_name_in_memory(name, offset):
    """Memory representation of variable name."""
    normname = bytearray(name.upper())
    if offset == 0:
        return values.size_bytes(name)
    elif offset == 1:
        return normname[0]
    elif offset == 2:
        if len(name) > 2:
            return normname[1]
        else:
            return 0
    elif offset == 3:
        if len(name) > 3:
            return len(name)-3
        else:
            return 0
    else:
        # rest of name is encoded such that c1 == 'A'
        return normname[offset-1] - ord(b'A') + 0xC1
def get_name_in_memory ( name , offset ) : normname = bytearray ( name . upper ( ) ) if offset == 0 : return values . size_bytes ( name ) elif offset == 1 : return normname [ 0 ] elif offset == 2 : if len ( name ) > 2 : return normname [ 1 ] else : return 0 elif offset == 3 : if len ( name ) > 3 : return len ( name ) - 3 else : return 0 else : # rest of name is encoded such that c1 == 'A' return normname [ offset - 1 ] - ord ( b'A' ) + 0xC1