{"name":"compileScript","title":"compileScript","type":"command","url":"https://community.bistudio.com/wiki/compileScript","revid":365141,"updated":"2024-07-26T16:44:13Z","groups":["System"],"status":"ok","games":{"arma3":"2.02"},"since":"arma3 2.02","arma3_since":"2.02","description":"This command is an alias for `compile(Final) (prefixHeader + preprocessFileLineNumbers path)`. See description of preprocessFileLineNumbers for more details.\nIn addition, this command can also compile SQF Bytecode files, which can reduce compilation time. If both a .sqf file and .sqfc file are pressing in the the path, this command will automatically compile the .sqfc file.","syntaxes":[{"syntax":"compileScript [path, final, prefixHeader]","params":[{"name":"path","type":"String","description":"path to script file","type_expr":"String"},{"name":"final","type":"Boolean","optional":true,"default":"false","description":"compile final, see compileFinal","type_expr":"Boolean","text":"final: Boolean - (Optional, default false) compile final, see compileFinal"},{"name":"prefixHeader","type":"String","optional":true,"default":"\"\"","description":"value added at the beginning of the file","type_expr":"String","text":"prefixHeader: String - (Optional, default \"\") value added at the beginning of the file"}],"returns":{"type":"Code","type_expr":"Code"},"form":"unary","right":{"text":"[path, final, prefixHeader]"}}],"examples":[{"text":"```sqf\ncompileScript [\"a3\\props_f_enoch\\military\\equipment\\scripts\\meteo.sqf\"];\n// has the same functionality as\ncompile preprocessFileLineNumbers \"a3\\props_f_enoch\\military\\equipment\\scripts\\meteo.sqf\";\n```","code":["compileScript [\"a3\\props_f_enoch\\military\\equipment\\scripts\\meteo.sqf\"];\n// has the same functionality as \ncompile preprocessFileLineNumbers \"a3\\props_f_enoch\\military\\equipment\\scripts\\meteo.sqf\";"]}],"see_also":["compile","compileFinal","preprocessFileLineNumbers","preprocessFile","call","spawn"]}