Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #8570 > unrolled thread

ifdef question

Started byMartin <Martin@spam.spam>
First post2015-10-28 10:05 +0000
Last post2015-10-28 14:45 +0100
Articles 2 — 2 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  ifdef question Martin <Martin@spam.spam> - 2015-10-28 10:05 +0000
    Re: ifdef question "Wolfgang Riedmann" <wriedmann@gmail.com> - 2015-10-28 14:45 +0100

#8570 — ifdef question

FromMartin <Martin@spam.spam>
Date2015-10-28 10:05 +0000
Subjectifdef question
Message-ID<n0q6gl$has$1@dont-email.me>
Hello all

I am writing code to handle different entry formats and I am trying to 
minimise the code bases.

I am writing numeric handling for people who do not know that the rest 
of the world uses mm.

So I have written a class to replace all mm entry fields, but the class 
has two forms with different INHERITS.

      Base
+------+------+
|             |
|             inch control code
|             |
|             inch formatting code
mm format     |
|             |
my numeric field class

So I want my bottom class in this to be ifdefed rather than via comments

               EnterCallback
     |               InchEdit
SLE_N4              SLE_NIWH
               SLE_WH


Current example code

CLASS SLE_WH		INHERIT SLE_N4					//	Top level class for width & height
//	CLASS SLE_WH	INHERIT SLE_NIWH

CLASS SLE_N4		INHERIT SLE_EnterCallBack		//	mm class for width & height



CLASS SLE_NIWH		INHERIT SLE_InchEdit			//	inch class for width & height
CLASS SLE_InchEdit	INHERIT SLE_EnterCallback


CLASS SLE_EnterCallback	INHERIT SingleLineEdit


And I have not been able to use ifdef in the class definition for SLE_WH

Is this possible?

Thanks Martin

[toc] | [next] | [standalone]


#8575

From"Wolfgang Riedmann" <wriedmann@gmail.com>
Date2015-10-28 14:45 +0100
Message-ID<d9c1sqFmasiU1@mid.individual.net>
In reply to#8570
Hi Johan,

this will work with Vulcan.NET because it is file based.

With VO it will not work because it is entity based.

#ifdef and collegues in VO will work only in one entity.

Wolfgang



Johan Nel wrote:

> Martin,
> On 2015/10/28 12:05, Martin wrote:
> > And I have not been able to use ifdef in the class definition for
> > SLE_WH
> > 
> > Is this possible?
> 
> Tested the following and it compiles correctly.
> 
> #ifdef DEBUG
> CLASS Xyz INHERIT y
> #else
> CLASS Xyz INHERIT z
> #endif
> END CLASS
> 
> #ifdef DEBUG
> CLASS y
> END CLASS
> #else
> CLASS z
> END CLASS
> #endif
> You will need to #define MM in the .prg or in a .vh file that you
> then obviously need to #include in the .prg
> 
> HTH,



-- 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web