Error Generic Error in Expression: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Some wiki formatting)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''Editing Error Generic Error in Expression'''
This error occurs when the type of data an operator is expecting does not match.  
 
This error simply means that the variable you are dividing contains zero or that you try to select a not existing element of an array.




Line 12: Line 10:


'''Example:'''
'''Example:'''
<sqf>
_myString = "The meaning of life is " + 42; // error
_myString = "The meaning of life is " + str 42; // OK
_myString = "The meaning of life is " + format ["%1", 42]; // OK - {{Name|ofp|short}}
</sqf>


_myVar = [1,2,3] [[select]] 15


[[Category:Common Scripting Errors]]
[[Category:Common Scripting Errors]]

Latest revision as of 14:35, 27 March 2024

This error occurs when the type of data an operator is expecting does not match.


Compatibility:

Version 1.96


Example:

_myString = "The meaning of life is " + 42; // error _myString = "The meaning of life is " + str 42; // OK _myString = "The meaning of life is " + format ["%1", 42]; // OK - OFP