Reports whether the optional parser or compiler component is available.
This function is exported by the KS module.
IsAvailable := IsComponentAvailable(Capability)
Type: String
Specify "parser" or "compiler". "parsing" and "compilation" are accepted as synonyms. The name is not case-sensitive.
Type: Integer (Boolean)
Returns 1 if the installed or embedded unit is compatible and can be loaded, otherwise 0. Checking a component loads it.
A ValueError is thrown if Capability is not a recognised name.
A compiled script which statically calls RunScript, CompileScript or ValidateScript includes the component it needs. Use --without-compiler when the script should run without dynamic compilation; see Optional Scripting Components.
Uses dynamic compilation only when the compiler is present.
#Import "Ks" { IsComponentAvailable, RunScript }
if IsComponentAvailable("compiler")
RunScript('FileAppend "compiled dynamically``n", "*"')
else
FileAppend "compiler not installed`n", "*"
ValidateScript and CompileScript, RunScript, Command-Line Options