def get_program_number(txt_row):
    """ Checks if the current line of text contains a program 
    definition.
    Args:
      txt_row (string): text line to check.
    Returns:
      An integer number. If program number cannot be found, or is 
      invalid in some way, a large negative number is returned.
    """
    num = -9999
    len_txt = len(txt_row)
    
    if (len_txt < 2):
        return num
    
    if (txt_row[0] == "O"):
        numeric_part = txt_row[1:len_txt]
        try:
            conv_num = int(numeric_part)
            num = conv_num
        except ValueError:
            pass
    
    return num