CheckLaserCode
Appearance
| Environment: | Mission Scripting | |
|---|---|---|
| Function: | CheckLaserCode | |
| Function Description: | Validates that a supplied laser code is within the official DCS World range (1111–2688) and matches the expected four‑digit pattern. The function converts the number to a string, checks its numeric bounds, then uses a regular expression to confirm it follows the [1-2][1-8][1-8][1-8] format. If CMM.DEBUG is true, diagnostic messages are logged. | |
| File Location: | cmm.DCSFunctions.lua | |
| Syntax: | CMM.CheckLaserCode( number LaserCode ) | |
| Return Value: | boolean | |
| Parameters: | Name | Description |
| LaserCode | The laser code value to validate (e.g., 1788). | |
| Example: | env.info("Is LaserCode valid? "..tostring(CMM.CheckLaserCode(1788))) | |
| Example Description: | Demonstrates checking whether the laser code "1788" is valid and logging the result. | |
| Related Functions: | ||
| Notes: | ||