Skip to content

Instantly share code, notes, and snippets.

@jschilli
Created September 9, 2011 16:11
Show Gist options
  • Save jschilli/1206631 to your computer and use it in GitHub Desktop.
Save jschilli/1206631 to your computer and use it in GitHub Desktop.
jscript version
// ERROR CODES
var ERR_OK = 0;
var exit_code = ERR_OK;
// EXECUTION
WScript.Echo(!this.JSON?"NO JSON":"JSON");
WScript.Echo(GetScriptEngineInfo());
WScript.Echo(GetJScriptConditionalInfo());
WScript.Quit(exit_code);
// FUNCTIONS
function GetScriptEngineInfo()
{
var s;
s = ""; // Build string with necessary info.
s += ScriptEngine() + " Engine Version: ";
s += ScriptEngineMajorVersion() + ".";
s += ScriptEngineMinorVersion() + ".";
s += ScriptEngineBuildVersion();
return(s);
}
function GetJScriptConditionalInfo()
{
// Set conditional compilation so @_jscript_version
// variable will be defined.
@cc_on
// Display the JScript verision number using
// the @_jscript_version variable
var s;
s = ""; // Build string with necessary info.
s += ScriptEngine() + " Conditional Version: ";
s += @_jscript_version;
return(s);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment