This is taken directly from a newsgroup posting on softvelocity.public.clarion6. I hope Robert doesn’t mind me reproducing this here, I think it is a very helpful explanation that should be useful to folks running into SEGDEF problems with Clarion…

Re: Any increase on DCT & Window limits?
On 22/01/2004 12:20:26 AM, robert.zaunere wrote:

There are many theories floating about with regard to this "limit",
unfortunately none of them are accurate.  There is a Zero correlation to any
16bit issue in C6 with this topic of SEGDEFs, as 16bit is not even supported
for compilations, and the segment limit has not changed from C5x.

As explanation as to what does happen, the linker must collect information
about object and resource files to be linked into the target. The limit for
number of segments per object file is ~16k. 

The compiler produces segments for things like:

– Every Procedure or ROUTINE is a separate segment;
– Every static variable or constant string is a separate segment;
– Every FILE structure produces 5 segments, plus if the FILE declaration has
NAME, OWNER or driver string, one segment
  per every for one of these strings, plus one possible segment if FILE is
threaded, every KEY, every Memo, every VIEW, every QUEUE, etc. etc.

So in general, the current linker limit means that a single source file can
have _thousands of declared (and used in the program) variables. The most
probable ways to get the "too many SEGDEF…" error are:

1- to include too many INCLUDEs that declare variables; solution is
  to include files on the module level rather than globally everywhere
  where it is possible
2- to declare too many FILEs with large number of KEYs and/or MEMOs in
  one source file (the main source file, as a rule);

#1 is your control. As for #2 its also in your control, but we’ll be providing
template support in C6.1 that will allow you to easily split the file structs
generated from extremely large DCTs (those with with many hundreds of files
defined in them) into > 1 source modules.  That means that when such DCTs
produce an excess of  the ~16000 segment limit you can get past it.  However,
there are other alternatives you can take right now, like reducing the # of
files declared in a single DCT to something more in line with what Files are
really being used in the APP, or to declare files on the member module level if
this is possible (i.e. the FILE is only used in particular procedure ).  But
the template solution will be forthcoming.


Robert Zaunere
SoftVelocity Inc.



Sublime Text is a sophisticated text editor for code, html and prose. You’ll love the slick user interface and extraordinary features.

I must say that after a few days of use I totally agree! This is looking like the top contender to replace TextPad, something I have been trying to do for years without any success. TextPad is great but falls short in a few places and until now I have not found anything that comes close to its ease of use and performance…

Of course there is no syntax definition available for clarion files by default so I have made a start on one.

Disclaimer, I am new to Sublime Text as well as GitHub but I will plug away at it for a while and see what comes out!

You should take a look at the official help for creating Syntax Definitions before trying to understand the files in the GitHub repo. When it is a little more mature I will create a package that can be loaded easily, for now you will have to do it the hard way 🙂

Grab the code for SublimeClarion on GitHub.



Things have been pretty busy with work these last few weeks and I am waiting to see, along with everyone else, what happens with Clarion 8. There are still loads of addin ideas and plenty of additional features and fixes waiting for the existing addins so things have certainly not stopped, just on a little break.

I suppose something I should be doing in the meantime is getting the source code uploaded!

(Also, stay tuned for the ClarionMag article. It should coming any day now I am sure…)