Cicode Programming Reference > Cicode Function Categories > Form Functions Introduction > FormRadioButton


Adds a radio button to the current form, allowing the operator to make a selection from a multiple choice list. You should call this function only after the FormNew() function and before the FormRead() function.

The radio button is added to the form at the specified column and row position. The width of the button will be sized to suit the text.

By default, all radio buttons are placed into the one group. If you require separate groups, use this function in conjunction with the FormGroupBox() function.


FormRadioButton(Col, Row, sText, sBuf)


The number of the column in which the button will be placed. Enter a number from 0 (column 1) to the form width - 1. For example, to place the button in column 8, enter 7.


The number of the row in which the button will be placed. Enter a number from 0 (row 1) to the form height - 1. For example, to place the button in row 6, enter 5.


The text associated with the radio button.


The string buffer in which to put the state of the radio button. You should initialize this buffer to the state of the button. When the form returns, this buffer will contain either '1' or '0' if the radio button is checked.

Return Value

The field handle if the radio button is successfully added, otherwise -1 is returned.

Related Functions

FormNew, FormRead, FormGroupBox, FormCheckBox


! Create a form, add radio buttons and then display the form.
! The operator may only select one radio button , either Fast, Medium or Slow
STRING sFast, sSlow, sMedium;
sFast = "1";
sMedium = "0";
sSlow = "0";
FormRadioButton(2 ,2,"Fast", sFast);
FormRadioButton(2, 3,"Medium", sMedium);
FormRadioButton(2 ,4,"Slow", sSlow);
If sFast = "1" THEN
! do fast stuff
IF sMedium = "1" THEN
! do Medium stuff
IF sSlow = "1" THEN
! do slow stuff

See Also

Form Functions