# Programming with String Controls

Use SetCtrlVal to set a string control to a particular string value. Use GetCtrlVal to obtain the current text of a string control. Use GetCtrlAttribute with the ATTR_STRING_TEXT_LENGTH attribute to determine the size of the buffer to pass to GetCtrlVal. Keep in mind that GetCtrlVal appends a NULL byte to the end of the text string, so you must make the buffer 1 byte larger than the value returned by GetCtrlAttribute.

## Data Binding

Linux Data binding is not supported on Linux.

You can bind string controls to a DataSocket source. Controls can have only one DataSocket connection. You must specify whether the access mode is READ mode or WRITE mode:

- READ mode—The control gets data from the DataSocket source. In READ mode, the value of the string control is updated automatically when the value changes at the source.
- WRITE mode—The control transfers data to the DataSocket source. In WRITE mode, the value at the DataSocket source is updated automatically when the value of the string control changes.

Use DSBindCtrl DSBindCtrl to bind a string control to a DataSocket source. Use DSUnbind DSUnbind to disconnect the string control from the DataSocket source.

The DataSocket source must hold text data.

You must enable the DataSocket option in the Edit Installer dialog box Drivers & Components Drivers & Components tab if your applications use data binding.