BIS fnc dbValueSet: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " |s1=[" to " |s1= [")
m (Some wiki formatting)
 
Line 9: Line 9:
|gr1= Database
|gr1= Database


|descr= Add value to Scripted Database. If current path does not exist it is created otherwise value is overwritten. The passed array gets modified.
|descr= Add value to Scripted Database. If the provided path does not exist it is created, otherwise the value is overwritten. The passed array gets modified.


|s1= [database, path, newvalue] call [[BIS_fnc_dbValueSet]]
|s1= [database, path, newvalue] call [[BIS_fnc_dbValueSet]]


|p1= database - [[Array]]: Database array
|p1= database - [[Array]]: database array
|p2= path - [[Array]]: Path to value
 
|p2= path - [[Array]]: path to value


|r1= [[Boolean]]: True if value was added
|r1= [[Boolean]]: True if value was added


|x1= <code>private _db = ["#MILLER", ["&KILLS", 1000, "&RANK", "CAPTAIN"]];
|x1= <sqf>
private _db = ["#MILLER", ["&KILLS", 1000, "&RANK", "CAPTAIN"]];
[_db, ["miller","kills"],200] call BIS_fnc_dbValueSet;
[_db, ["miller","kills"],200] call BIS_fnc_dbValueSet;
_db {{codecomment| //["#MILLER",["&KILLS",200,"&RANK","CAPTAIN"]]}}</code>
_db // ["#MILLER",["&KILLS",200,"&RANK","CAPTAIN"]]
</sqf>


|x2= <code>private _db = ["#MILLER", ["&KILLS", 1000, "&RANK", "CAPTAIN"]];
|x2= <sqf>
private _db = ["#MILLER", ["&KILLS", 1000, "&RANK", "CAPTAIN"]];
[_db, ["miller","iq"],200] call BIS_fnc_dbValueSet;
[_db, ["miller","iq"],200] call BIS_fnc_dbValueSet;
_db {{codecomment| //["#MILLER",["&KILLS",1000,"&RANK","CAPTAIN","&IQ",200]]}}</code>
_db // ["#MILLER",["&KILLS",1000,"&RANK","CAPTAIN","&IQ",200]]
</sqf>


|seealso= [[:Category:Function Group: Database|Database functions]] [[BIS_fnc_dbClassCheck]] [[BIS_fnc_dbClassId]] [[BIS_fnc_dbClassIndex]] [[BIS_fnc_dbClassList]] [[BIS_fnc_dbClassRemove]] [[BIS_fnc_dbClassReturn]] [[BIS_fnc_dbClassSet]] [[BIS_fnc_dbConfigPath]] [[BIS_fnc_dbImportConfig]] [[BIS_fnc_dbImportXML]] [[BIS_fnc_dbisClass]] [[BIS_fnc_dbisValue]] [[BIS_fnc_dbPrint]] [[BIS_fnc_dbSymbolClass]] [[BIS_fnc_dbSymbolValue]] [[BIS_fnc_dbValueCheck]] [[BIS_fnc_dbValueId]] [[BIS_fnc_dbValueIndex]] [[BIS_fnc_dbValueList]] [[BIS_fnc_dbValueRemove]] [[BIS_fnc_dbValueReturn]]
|seealso= [[:Category:Function Group: Database|Database functions]] [[BIS_fnc_dbClassCheck]] [[BIS_fnc_dbClassId]] [[BIS_fnc_dbClassIndex]] [[BIS_fnc_dbClassList]] [[BIS_fnc_dbClassRemove]] [[BIS_fnc_dbClassReturn]] [[BIS_fnc_dbClassSet]] [[BIS_fnc_dbConfigPath]] [[BIS_fnc_dbImportConfig]] [[BIS_fnc_dbImportXML]] [[BIS_fnc_dbisClass]] [[BIS_fnc_dbisValue]] [[BIS_fnc_dbPrint]] [[BIS_fnc_dbSymbolClass]] [[BIS_fnc_dbSymbolValue]] [[BIS_fnc_dbValueCheck]] [[BIS_fnc_dbValueId]] [[BIS_fnc_dbValueIndex]] [[BIS_fnc_dbValueList]] [[BIS_fnc_dbValueRemove]] [[BIS_fnc_dbValueReturn]]
}}
}}

Latest revision as of 23:29, 12 July 2022

Hover & click on the images for description

Description

Description:
Add value to Scripted Database. If the provided path does not exist it is created, otherwise the value is overwritten. The passed array gets modified.
Execution:
call
Groups:
Database

Syntax

Syntax:
[database, path, newvalue] call BIS_fnc_dbValueSet
Parameters:
database - Array: database array
path - Array: path to value
Return Value:
Boolean: True if value was added

Examples

Example 1:
private _db = ["#MILLER", ["&KILLS", 1000, "&RANK", "CAPTAIN"]]; [_db, ["miller","kills"],200] call BIS_fnc_dbValueSet; _db // ["#MILLER",["&KILLS",200,"&RANK","CAPTAIN"]]
Example 2:
private _db = ["#MILLER", ["&KILLS", 1000, "&RANK", "CAPTAIN"]]; [_db, ["miller","iq"],200] call BIS_fnc_dbValueSet; _db // ["#MILLER",["&KILLS",1000,"&RANK","CAPTAIN","&IQ",200]]

Additional Information

See also:
Database functions BIS_fnc_dbClassCheck BIS_fnc_dbClassId BIS_fnc_dbClassIndex BIS_fnc_dbClassList BIS_fnc_dbClassRemove BIS_fnc_dbClassReturn BIS_fnc_dbClassSet BIS_fnc_dbConfigPath BIS_fnc_dbImportConfig BIS_fnc_dbImportXML BIS_fnc_dbisClass BIS_fnc_dbisValue BIS_fnc_dbPrint BIS_fnc_dbSymbolClass BIS_fnc_dbSymbolValue BIS_fnc_dbValueCheck BIS_fnc_dbValueId BIS_fnc_dbValueIndex BIS_fnc_dbValueList BIS_fnc_dbValueRemove BIS_fnc_dbValueReturn

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note