| **Navigation:**  [[introduction.htm|Language Reference]] > 13 - Built-in Functions >====== CHANGE (change control field value) ====== | [[chain execute another program .htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[changes return changed queue .htm|{{btn_next_n.gif|Next page}}]] | | || {{newc7.jpg|NewC7.jpg}} **CHANGE(**//control,value//**)** {{blk2blue.jpg|blk2blue.jpg}} | **CHANGE** | Changes the //value// displayed in a //control// in an APPLICATION or WINDOW structure. | | //control// | Field number or field equate label of a window control field. | | //value// | A constant, variable, or valid expression containing the //control's// new value. | The **CHANGE** statement changes the //value// displayed in a //control// in an APPLICATION or WINDOW structure. CHANGE updates the //control's// USE variable with the //value//, clears all pending events, and then displays that new //value// in the control field. For example: **CHANGE(?dLocator, CLIP(dLocator) & 'D')** **Example:** **Screen WINDOW,PRE(Scr)** **        ENTRY(@N3),USE(Ctl:Code)** **        ENTRY(@S30),USE(Ctl:Name)** **        BUTTON('OK'),USE(?OkButton),KEY(EnterKey)** **        BUTTON('Cancel'),USE(?CanxButton),KEY(EscKey)** **       END** ** CODE** ** OPEN(Screen)** ** ACCEPT** **  CASE EVENT()** **  OF EVENT:Selected** **   CASE SELECTED()** **   OF ?Ctl:Code** **   ****CHANGE****(?Ctl:Code,4)             !Change Ctl:Code to 4 and display it** **    ?Ctl:Code{PROP:Touched} = TRUE  !Force Accepted Event** **   OF ?Ctl:Name** **   ****CHANGE****(?Ctl:Name,'ABC Company') !Change Ctl:Name to ABC Company and display** **    ?Ctl:Name{PROP:Touched} = TRUE  !Force Accepted Event** **   END** **  OF EVENT:Accepted** **   CASE ACCEPTED()** **   OF ?OkButton** **    BREAK** **   OF ?CanxButton** **    CLEAR(Ctl:Record)** **    BREAK** **   END** **  END** **See Also:** [[display write use variables to screen .htm|DISPLAY]] [[update write from screen to use variables .htm|UPDATE]] [[erase clear screen control and use variables .htm|ERASE]] [[contents return contents of use variable .htm|CONTENTS]] [[prop screentext.htm|PROP:ScreenText]]