| **Navigation:**  [[advanced topics 1.htm|Advanced Topics]] >====== ClarionCL.exe ============ (Command Line Interface to the Clarion IDE) ====== | [[driverops.htm|{{btn_prev_n.gif|Previous page}}]][[advanced topics 1.htm|{{btn_home_n.gif|Return to chapter overview}}]][[api calls and advanced resources.htm|{{btn_next_n.gif|Next page}}]] | | || The** ClarionCL** executable (found in the BIN dir) allows you to execute some IDE tasks from the command line without the need to start the Clarion IDE. The syntax for ClarionCL usage is as follows: **ClarionCL **[//switch //[//parameter// [//parameter// [']]][//switch //[//parameter// [//parameter// [']]] [']] For example: !Generates all APPs in the Solution D:\Examples\IPDriver\People>C:\Clarion\bin\CLARIONCL -ag people.sln ClarionCL can process either individual .APP files, or if you pass it a Solution file all APPs in the Solution are processed. You can then use [[msbuild tasks.htm|MSBUILD]] to comple the generated code. {{blk2blue.jpg|blk2blue.jpg}} **Switch Formats** Valid //switch// formats are as follows: **/id** **Example: C:\Clarion\BIN\clarionCL /?** **-id** **Example: C:\Clarion\BIN\clarionCL -?** **--id** **Example: C:\Clarion\BIN\clarionCL --?** **Valid Switches:** | **Id** | **Parameters** | **Description** | | ag | Application or solution file name | Generates the passed application, or all applications in the passed solution (*.SLN) file. (Enterprise Edition Only) | | agc | ON or OFF | Conditionally Generate Application:If the parameter is ON then conditional generation is on. If the parameter is OFF then conditional generation is off. If this switch is not set, then conditional generation is controlled by the Application Options settings set in the IDE.(Enterprise Edition Only) | | agd | ON or OFF | Generate #DEBUG statements:If the parameter is ON then debug generation is on. If the parameter is OFF then debug generation is off. If this switch is not set, then debug generation is controlled by the Application Options settings set in the IDE.(Enterprise Edition Only) | | aru | <;//application//> <;//name//><;//optionalParameters//> | Run a utility template:Supplying the name of the //application// the utility template is run against, plus the //name// of the utility template.**ClarionCL -aru C:\C7Examples\people\people.app MyUtility****NOTE: This switch should only be used with utility templates that require no user input (e.g., are auto-generating).****Optional parameters may be passed as defined in the addin file. See [[customizing the command line interface clarioncl exe .htm|Customizing the Command Line Interface (ClarionCL.EXE)]]**Regarding the utility template, use the [[miscellaneous symbols.htm|%UtilityArguments]] symbol to add parameters to the Utility template.Parameter values need to be enclosed in parenthesis**Example:**C:\C7\bin\ClarionCL /win /aru C:\XMLparse\people.app ExportApp(TemplateUtility) paramone(firstvalue),paramtwo(anothervalue) | | dx | //<;dictionary> <;textfile>// | Exports the //dictionary// to the //textfile//. If no extension is given for the textfile .dctx is assumed. If the textfile already exists, it will be overwritten. | | di | //<;dictionary> <;textfile>// | Creates a //dictionary// from a //textfile// (either dctx or txd). If the dictionary already exists it will be overwritten. If no extension is given for the textfile, then .dctx is assumed. | | fr | <;//Driver DLL//> | Registers a file driver.**ClarionCL -Fr ClaMEM.dll** | | rf | //file// | Find the passed file using the redirection system | | rs | //Redirection Section// | Activate the passed Section in the redirection file.  You only need to specify this switch if your redirection file uses a Section other than [Common] to specify location of generated files | | rt | | Traces the folders searched for the supplied filename.For example:ClarionCL -rt defaults.clw | | tl | | Displays a list of all registered templates | | tr | <;//template file//> | Attempts to register the template file passed as the parameter. The redirection file will be used to find the //template file// if the file name is supplied without a full path.For example, to register the ADO templates for ABC provide the name of the //template file//:**ClarionCL -tr \Clarion\template\win\abado.tpl**The -tr switch uses the redirection (*.red) file, so you do not have to supply the full path if the template file can be found using the redirection system:**ClarionCL -tr abado.tpl** | | tu | <;//classname//> | Attempts to unregister the template class passed as the parameter.For example, to unregister the ADO templates from both ABC and Clarion chains provide the template //classname//:**ClarionCL -tu ABC_ADO****ClarionCL -tu Clarion_ADO** | | v | <;//versionName//> | Specify which version of Clarion to use. VersionName should be enclosed in double quotes as shown below.**ClarionCL** will use the Current version of Clarion when generating applications or registering templates.For example to register the ADO templates in Clarion 6 you would write:**ClarionCL -tr abado.tpl -v "Clarion 6.0 Enterprise Edition"** | | win | | If both Clarion for Windows and Clarion.NET are installed, ClarionCL will use by default the Clarion.NET redirection file to find files. Use the /win switch to make ClarionCL use the Clarion for Windows redirection file. | | ai | <;//application//><;TXA name> | Import the TXA file (parameter 2) into .APP file (parameter 1) | | ax | <;//application//><;TXA name> | Export the .APP file (parameter 1) into the TXA file (parameter 2) | | ? | | Display a list of all switches supported by ClarionCL | {{notebox.jpg|NoteBox.jpg}} **The ****//id//**** is case insensitive!** **Usage Notes and Examples** 1.Running ClarionCL without any parameters is equivalent to: **ClarionCL /?** 2.Passing an invalid switch will cause ClarionCL to behave as though **ClarionCL /?** was called. **Examples:** **ClarionCL 'tr mytemplate.tpl** Attempts to register //mytemplate.tpl// **ClarionCL 'tu mytemplate.tpl** Attempts to unregister //mytemplate.tpl// **Exit Code** ClarionCL will return an exit code of 0 if no errors occurred. Otherwise the exit code is set to the total number of errors that occurred during the run. **Error Codes** | **Error Code** | **Description** | | CLCE001 | An Unhandled Exception was thrown | | CLCE002 | There were no switches registered via any .addin file | | CLCE003 | Invalid parameters for the method | | CLCE004 | Not enough parameters where supplied to run the command. The switch is ignored | | CLCE005 | Unknown switch | | CLCE006 | The version supplied in the /v switch is not in the list of registered Clarion versions | | DCTE001 | The file could not be accessed | | DCTE002 | Cannot delete destination file | | DCTE003 | Cannot create destination file | | DCTE004 | Cannot import text | | DRVE001 | Cannot register the file driver | | GENE100 | Invalid File Name passed to the /ag switch | **Warning Codes** | **Error Code** | **Description** | | CLCW001 | A duplicate switch was passed, but the switch can only appear once. Only the first occurrence of the switch is processed | | CLCW002 | Too many parameters were supplied for the command. All extra parameters are ignored | | CLCW003 | The first parameter to ClarionCL does not begin with / or - | | CLCW004 | The command line switch specified in the "runbefore" attribute does not exist | | GENW001 | The parameter must be 'on' or 'off'. The switch was ignored. | **See also:** [[customizing the command line interface clarioncl exe .htm|Customizing the Command Line Interface (ClarionCL.EXE)]]