BIS fnc parseNumberSafe: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (more examples)
m (page filled)
Line 1: Line 1:
{{Function|= Comments
{{Function


| arma3 |Game name=
|game1= arma3


|1.95|Game version=
|version1= 1.95


<!---|arg= local |Multiplayer Arguments=--->
<!--|serverExec= server-->


<!---|eff= local |Multiplayer Effects=--->
<!--|arg= local-->


| <pre>/*
<!--|eff= local-->
Author:
Killzone_Kid


Description:
|descr= Converts expression into a number (or array of expressions into an array of numbers).<br>
Converts expression into a number (or array of expressions into an array of numbers)
If expression does not return a number, 0 is returned.
If expression does not return a number, 0 is returned


Parameter(s):
|s1= [input] call [[BIS_fnc_parseNumberSafe]]|=Syntax
NUMBER, STRING, ARRAY, SIDE, CONFIG (NUMBER, STRING, ARRAY)
Returns:
NUMBER (or ARRAY of NUMBERs if ARRAY is passed as an argument)
*/</pre>{{Informative|Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]]}} |Description=


|[] call [[BIS_fnc_parseNumberSafe]]|Syntax=
|p1= input: [[Number]], [[String]], [[Array]], [[Side]], [[Config]] or [[Array]] of those data types


|p1= parameter: Datatype - (Optional, default defValue) description |Parameter 1=
|r1= [[Number]] or [[Array|array]] of [[Number|numbers]] if [[Array|array]] is passed as an argument|Return value=
 
|Datatype - description|Return value=


|x1= <code><nowiki>[</nowiki>[[safeZoneX]],[[safeZoneWAbs]],[[configFile]]<nowiki>]</nowiki> [[call]] [[BIS_fnc_parseNumberSafe]];{{cc|Returns [-0.452381,1.90476,0]}}</code>|Example 1=
|x1= <code><nowiki>[</nowiki>[[safeZoneX]],[[safeZoneWAbs]],[[configFile]]<nowiki>]</nowiki> [[call]] [[BIS_fnc_parseNumberSafe]];{{cc|Returns [-0.452381,1.90476,0]}}</code>|Example 1=
Line 36: Line 26:
|exec= call |Execution=
|exec= call |Execution=


|[[BIS_fnc_parseNumber]] [[parseNumber]] |See also=
|seealso= [[parseNumber]] [[BIS_fnc_parseNumber]]
}}
}}



Revision as of 20:26, 27 February 2020

Hover & click on the images for description

Description

Description:
Converts expression into a number (or array of expressions into an array of numbers).
If expression does not return a number, 0 is returned.
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[input] call BIS_fnc_parseNumberSafe
Parameters:
input: Number, String, Array, Side, Config or Array of those data types
Return Value:
Number or array of numbers if array is passed as an argument

Examples

Example 1:
[safeZoneX,safeZoneWAbs,configFile] call BIS_fnc_parseNumberSafe;// Returns [-0.452381,1.90476,0]
Example 2:
["1337","2013",date] call BIS_fnc_parseNumberSafe;// Returns [1337,2013,[2036,1,1,6,58]]
Example 3:
[west,east,independent,civilian] call BIS_fnc_parseNumberSafe;// Returns [1,0,2,3]

Additional Information

See also:
parseNumber BIS_fnc_parseNumber

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