# SBProfile

These are functions that can be accessed from scripts via the **SBProfile** object. For example:

```
SBProfile.Name

```

The **SBProfile** object is only accessible from [Profile Configuration](ProfileConfigurationScripts.md) scripts.

All the example code below is written in using the [Pascal](PascalScriptLanguage.md) scripting language.

**function GetCheckbox(Tag);**

**Tag:** The tag ID of the checkbox control

**Return value:** TRUE if the checkbox is ticked

This function returns the state of a checkbox control (created with [AddCheckbox](SBProfile.md#procedure_addcheckbox_caption__tag__)). To change the state of a checkbox you can use [SetCheckbox](SBProfile.md#function_setcheckbox_value__tag__).

**function GetComboBoxIndex(Tag);**

**Tag:** The tag ID of the combobox control

**Return value:** The index of the selected item (zero is the first item, -1 if no item is selected)

This function returns the index of the currently selected item in a combobox control (created with [AddComboBox](SBProfile.md#procedure_addcombobox_listonly__tag__)). Note that if the control can be edited then the index can be -1, e.g. the user has entered their own text instead of selecting an item. In that case you can get the text entered by using [GetComboBoxText](SBProfile.md#function_getcomboboxtext_tag__).

To change the state of a checkbox you can use [SetComboBoxItem](SBProfile.md#function_setcomboboxitem_itemindex__tag__) or [SetComboBoxText](SBProfile.md#function_setcomboboxtext_itemtext__tag__).

**function GetComboBoxText(Tag);**

**Tag:** The tag ID of the combobox control

**Return value:** The text in the combobox control

This function returns the text entered into a combobox control (created with [AddComboBox](SBProfile.md#procedure_addcombobox_listonly__tag__)).

To change the state of a checkbox you can use [SetComboBoxItem](SBProfile.md#function_setcomboboxitem_itemindex__tag__) or [SetComboBoxText](SBProfile.md#function_setcomboboxtext_itemtext__tag__).

**function GetEdit(Tag);**

**Tag:** The tag ID of the edit control

**Return value:** The text in the edit control

This function returns the text in an edit control (created with [AddEdit](SBProfile.md#procedure_addedit_caption__maxlen__numbersonly__password__tag__)). To change the text in an edit control you can use [SetEdit](SBProfile.md#function_setedit_value__tag__).

**function GetRadioGroup(Tag);**

**Tag:** The tag ID of the radiogroup control

**Return value:** The index of the selected item (zero is the first item, -1 if no item is selected)

This function returns the index of the currently selected item in a radiogroup control (created with [AddRadioGroup](SBProfile.md#procedure_addradiogroup_caption__tag__)).

To change the state of a checkbox you can use [SetRadioGroup](SBProfile.md#function_setradiogroup_itemindex__tag__).

**function SetButton(Caption, Tag);**

**Value:** The text set the button control to

**Tag:** The tag ID of the button control

This sub routine sets the text of a button control (created with [AddButton](SBProfile.md#procedure_addbutton_caption__tag__)).

NOTE: This function is not available when using the old Windows scripting.

**function SetCheckbox(Value, Tag);**

**Value:** Pass TRUE to tick the checkbox

**Tag:** The tag ID of the edit control

This sub routine sets the state of a checkbox control (created with [AddCheckbox](SBProfile.md#procedure_addcheckbox_caption__tag__)). To get the state of a checkbox control you can use [GetCheckbox](SBProfile.md#function_getcheckbox_tag__).

**function SetComboBoxItem(ItemIndex, Tag);**

**ItemIndex:** The item index to use (0 is the first item, -1 means nothing selected)

**Tag:** The tag ID of the combobox control

This sub routine sets the selected item index of a combobox control (created with [AddComboBox](SBProfile.md#procedure_addcombobox_listonly__tag__)).

To get the current index of a checkbox control you can use [GetComboBoxIndex](SBProfile.md#function_getcomboboxindex_tag__).

**function SetComboBoxText(ItemText, Tag);**

**ItemText:** The text to set the combobox control to use

**Tag:** The tag ID of the combobox control

This sub routine sets the text of a combobox control (created with [AddComboBox](SBProfile.md#procedure_addcombobox_listonly__tag__)).

To get the text of a checkbox control you can use [GetComboBoxText](SBProfile.md#function_getcomboboxtext_tag__).

**function SetEdit(Value, Tag);**

**Value:** The text to put into the edit control

**Tag:** The tag ID of the edit control

This sub routine sets the text in an edit control (created with [AddEdit](SBProfile.md#procedure_addedit_caption__maxlen__numbersonly__password__tag__)). To get the text in an edit control you can use [GetEdit](SBProfile.md#function_getedit_tag__).

**function SetLabel(Caption, Tag);**

**Value:** The text set the label control to

**Tag:** The tag ID of the label control

This sub routine sets the text of a label control (created with [AddLabel](SBProfile.md#procedure_addlabel_caption__tag__)).

**function SetRadioGroup(ItemIndex, Tag);**

**ItemIndex:** The item index to use (0 is the first item, -1 means nothing selected)

**Tag:** The tag ID of the radiogroup control

This sub routine sets the selected item index of a radiogroup control (created with [AddRadioGroup](SBProfile.md#procedure_addradiogroup_caption__tag__)).

To get the current index of a radiogroup control you can use [GetRadioGroup](SBProfile.md#function_getradiogroup_tag__).

**procedure AddButton(Caption, Tag);**

**Caption:** Pass the caption text to use for the button control

**Tag:** Pass the unique tag ID for this control

Adds a button control to the profile setup window.

This function should only be called from [ConfigSetupDisplay](ProfileConfigurationScripts.md#procedure_configsetupdisplay_).

NOTE: This function is not available when using the old Windows scripting.

**procedure AddCheckbox(Caption, Tag);**

**Caption:** Pass the caption text to use for the control

**Tag:** Pass the unique tag ID for this control

Adds a checkbox control to the profile setup window.

This function should only be called from [ConfigSetupDisplay](ProfileConfigurationScripts.md#procedure_configsetupdisplay_).

**procedure AddComboBox(ListOnly, Tag);**

**ListOnly:** If the combobox text cannot be edited then pass TRUE

**Tag:** Pass the unique tag ID for this control

Adds a combobox control to the profile setup window. To add items to the combobox use [AddComboBoxItem](SBProfile.md#procedure_addcomboboxitem_value__tag__).

This function should only be called from [ConfigSetupDisplay](ProfileConfigurationScripts.md#procedure_configsetupdisplay_).

**procedure AddComboBoxItem(Value, Tag);**

**Value:** The text to add to the combobox

**Tag:** The tag ID of the combobox to add the item to

Adds an item to a combobox control.

This function should only be called from [ConfigSetupDisplay](ProfileConfigurationScripts.md#procedure_configsetupdisplay_).

**procedure AddEdit(Caption, MaxLen, NumbersOnly, Password, Tag);**

**Caption:** Pass the caption text to use for the edit control

**MaxLen:** The maximum length of text that can be entered into the edit control

**NumbersOnly:** Pass as TRUE if the edit control is for numbers only (no negative signs or decimal points)

**Password:** Pass as TRUE if the edit control is for passwords

**Tag:** Pass the unique tag ID for this control

Adds an edit control to the profile setup window.

This function should only be called from [ConfigSetupDisplay](ProfileConfigurationScripts.md#procedure_configsetupdisplay_).

**procedure AddLabel(Caption, Tag);**

**Caption:** Pass the caption text to use for the label

**Tag:** Pass the unique tag ID for this label

Adds a label to the profile setup window.

This function should only be called from [ConfigSetupDisplay](ProfileConfigurationScripts.md#procedure_configsetupdisplay_).

**procedure AddRadioGroup(Caption, Tag);**

**Caption:** The caption to use for the control

**Tag:** Pass the unique tag ID for this control

Adds a radio group control to the profile setup window. To add items to the combobox use [AddRadioGroupItem](SBProfile.md#procedure_addradiogroupitem_caption__tag__).

This function should only be called from [ConfigSetupDisplay](ProfileConfigurationScripts.md#procedure_configsetupdisplay_).

**procedure AddRadioGroupItem(Caption, Tag);**

**Caption:** The caption text to use for the new radio item

**Tag:** The tag ID of the radio group to add the item to

Adds an item to a radio group control.

This function should only be called from [ConfigSetupDisplay](ProfileConfigurationScripts.md#procedure_configsetupdisplay_).

**procedure EnableControl(Enable, Tag);**

**Value:** Pass TRUE to enable the control, and FALSE to disable it

**Tag:** The tag ID of the control to enabled or disable

Enables or disables a control. For example, to disable or enable another control based of a checkbox being checked or not:

```
SBProfile.EnableControl(SBProfile.GetCheckbox(1), 2);
```

**Property Group**

Returns the TRUE if this is a group profile.

This property is read-only.

**Property Name**

Returns the name of the profile.

This property is read-only.

**Property UsesScript**

Returns the TRUE if this profile is using this script. For example, you may have a script that is both a configuration and run-time script. Although the script may be enabled as a configuration script, the profile that is currently being edited may not be using the profile as a run-time script.

This property is read-only.

All Content: 2BrightSparks Pte Ltd © 2003-2026
