---
name: "BIS_fnc_initSliderValue"
type: function
status: ok
groups: ["Eden Editor"]
arma3_since: "1.58"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_initSliderValue
revid: 352075
updated: 2024-02-01T23:24:42Z
---

# BIS_fnc_initSliderValue

*Function · Eden Editor · Arma 3 v1.58*

## Description

Initialises a slider attribute control within the Eden Editor. Can also be used outside of Eden Editor. 

> [!NOTE]
> The slider and the edit control have to share the same controls group!

## Syntax

```sqf
[ctrlSlider, ctrlEdit, unit, default] call BIS_fnc_initSliderValue
```

**Parameters:**

- `ctrlSlider`: [Control](../topics/Control.md) - slider control, usually the first control within the controls group
- `ctrlEdit`: [Control](../topics/Control.md) - edit Box, usually the second control within the controls group
- `unit`: [String](../topics/String.md) - measurement unit added behind the number within the edit box ("%" by default)
- `default`: [Number](../topics/Number.md) - when present, only the value is set, functionality is not initialized

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

```sqf
[_this controlsGroupCtrl 100, _this controlsGroupCtrl 101, "m", 50] call BIS_fnc_initSliderValue;
```

### Example 2

```sqf
// Execute in Eden Editor to preview the functionality
if !(is3DEN) exitWith {};

private _display = findDisplay 313;
private _GRID_H = pixelGrid * pixelH * 0.5;
private _GRID_W = pixelGrid * pixelW * 0.5;

// Function only works if slider and edit control share the same group
private _ctrlGroup = _display ctrlCreate ["ctrlControlsGroupNoScrollbars", -100];
_ctrlGroup ctrlSetPosition [0, 0, 101 * _GRID_W, 5 * _GRID_H];

// Setup the slider
private _ctrlSlider = _display ctrlCreate ["ctrlXSliderH", -101, _ctrlGroup];
_ctrlSlider ctrlSetPosition [0, 0, 50 * _GRID_W, 5 * _GRID_H];
_ctrlSlider sliderSetRange [100, 2000];

// Setup the edit control
private _ctrlEdit = _display ctrlCreate ["ctrlEdit", -102, _ctrlGroup];
_ctrlEdit ctrlSetPosition [51 * _GRID_W, 0, 25 * _GRID_W, 5 * _GRID_H];

_ctrlSlider ctrlCommit 0;
_ctrlEdit ctrlCommit 0;
_ctrlGroup ctrlCommit 0;

// Set default value
[_ctrlSlider, _ctrlEdit, "m", 200] call BIS_fnc_initSliderValue;

// Added eventhandlers to controls
[_ctrlSlider, _ctrlEdit, "m"] call BIS_fnc_initSliderValue;
```

## See also

Eden Editor: Configuring Attributes

<sub>Source: [BI Community Wiki — BIS fnc initSliderValue](https://community.bistudio.com/wiki/BIS_fnc_initSliderValue) (revision 352075).</sub>
