<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def SetValue(self, row, col, value, refresh=True):
 """Set the value of a cell, merge line breaks"""


        # Join code that has been split because of long line issue
        value = "".join(value.split("\n"))

        key = row, col, self.grid.current_table

        old_code = self.grid.code_array(key)
        if old_code is None:
            old_code = ""

        if value != old_code:
            self.grid.actions.set_code(key, value)