Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Include Page
DCL to CML changes under way
DCL to CML changes under way

Downloading the

...

CML

If you haven't already done so, either download the DCLCML or (preferably) clone the repository using GitHub for Windows.

You'll now have a directory tree that looks something like this:

Image RemovedImage Added

You won't see the .git directory unless you have Explorer configured to show hidden files/folders, and you won't see the green check marks unless you have TortoiseGit installed (but that's another story, and TortoiseGit isn't a requirement here)

The RED file: To modify or not to modify

In order to use the DCL CML files you need to find some way of getting those files into Clarion's field of view. You have two choices:

  1. Copy the files to the appropriate Clarion directories
  2. Modify Clarion's redirection file to include the appropriate DCL CML directories

I favor the latter approach because it means that Clarion is always using the latest DCL CML files. 

There are four lines that have to be modified in the Clarion80.red file (which you can find in Clarion's bin directory). Here are what the changes look like in my RED.

Image Removed

To update your RED file:

...

Panel

[Common]
*.chm = %BIN%;%ROOT%\Accessory\bin
*.tp? = %ROOT%\template\win; F:\Clarion\ClarionMagLibrary\template
*.trf = %ROOT%\template\win
*.txs = %ROOT%\template\win
*.stt = %ROOT%\template\win
*.* = .; %ROOT%\libsrc\win; %ROOT%\images; %ROOT%\template\win; F:\Clarion\ClarionMagLibrary\libsrc
*.lib = %ROOT%\lib; F:\Clarion\ClarionMagLibrary\lib
*.obj = %ROOT%\lib
*.res = %ROOT%\lib
*.hlp = %BIN%;%ROOT%\Accessory\bin
*.dll = %BIN%;%ROOT%\Accessory\bin; F:\Clarion\ClarionMagLibrary\bin
*.exe = %BIN%;%ROOT%\Accessory\bin; F:\Clarion\ClarionMagLibrary\bin
*.tp? = %ROOT%\Accessory\template\win
*.txs = %ROOT%\Accessory\template\win
*.stt = %ROOT%\Accessory\template\win
*.lib = %ROOT%\Accessory\lib
*.obj = %ROOT%\Accessory\lib
*.res = %ROOT%\Accessory\lib
*.dll = %ROOT%\Accessory\bin
*.* = %ROOT%\Accessory\images; %ROOT%\Accessory\resources; %ROOT%\Accessory\libsrc\win; %ROOT%\Accessory\template\win

I should probably write a utility to update the RED. 

Using the library

There are two ways to use the classes; you can compile the source code, or you can use use the precompiled DLL. 

In either case, to make use of any of the classes you need to include the appropriate .INC file somewhere in your source, e.g.

Include('DCLCML_System_String.inc'),once

Make sure you use the ,ONCE attribute.

By default DCL the CML assumes you want to use the supplied LIB and DLL, so you'll need to add DevRoadmapsClarionCMagLib.lib to your project. If you don't do this you'll get any number of unresolved external error messages. 

Which version of the DLL/LIB do I need?

The default compiled version of the library is for the latest Clarion release (or at least the latest one I happen to have installed on my machine). As of this writing, that means Clarion 9.1 If you're using an earlier version of Clarion have a look under the bin\versions and lib\versions directories for a suitable LIB and DLL. You may want to update your RED file to look in those directories. 

If you want to compile the classes

If you want to compile the classes you won't need the LIB and DLL, but you will need to set a compile pragma in your project properties:

_Compile_DCLCML_Class_Source_=>1

 

...