QuickList.SetValue
------------------

Sets a value in the list.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [List](component_List.md) | [4.4](newinversion44.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "QuickList.SetValue"; ListRef; Index; Text ) 

**MBS**( **"QuickList.SetValue";** /\* Sets a value in the list. \*/  
**$ListRef**; /\* The reference to the list returned from [QuickList.New](QuickListNew.md) function.e.g. $List \*/   
**$Index**; /\* The index of the value to get. Must be in range from 0 to [QuickList.Count](QuickListCount.md)-1. \*/   
**$Text**) /\* The text to add.e.g. "Hello" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| ListRef | The reference to the list returned from [QuickList.New](QuickListNew.md) function. | $List |
| Index | The index of the value to get. Must be in range from 0 to [QuickList.Count](QuickListCount.md)-1. | $index |
| Text | The text to add. | "Hello" |

### Result

Returns OK or error.

### Description

Sets a value in the list.  
If index is equal to count, we append the text to the list.  
### Examples

Tries set value:

 Set Variable \[$list ; Value: MBS ( "[QuickList.New](QuickListNew.md)"; "Hello¶World¶Test" )\]  
Set Variable \[$r ; Value: MBS ( "QuickList.SetValue"; $list ; 0; "Element 0" )\]  
Show Custom Dialog \["List contains"; MBS ( "[QuickList.GetList](QuickListGetList.md)"; $list )\]  
Set Variable\[$r ; Value: MBS ( "[QuickList.Release](QuickListRelease.md)"; $list )\]  
### See also

- [QuickList.AddValue](QuickListAddValue.md)
- [QuickList.Count](QuickListCount.md)
- [QuickList.GetList](QuickListGetList.md)
- [QuickList.HasValues](QuickListHasValues.md)
- [QuickList.New](QuickListNew.md)
- [QuickList.Release](QuickListRelease.md)
- [QuickList.RemoveValue](QuickListRemoveValue.md)
- [QuickList.Serialize](QuickListSerialize.md)
- [QuickList.SetList](QuickListSetList.md)
- [QuickList.Shuffle](QuickListShuffle.md)

This function checks for a license.

Created 21st September 2014 , last changed 14th December 2023

  
[QuickList.SetList](QuickListSetList.md) - [QuickList.Shuffle](QuickListShuffle.md)

[HTML Version](QuickListSetValue.shtml)