Use general function to set variable