Recent

Author Topic: [SOLVED] Stop compilation for LCL 1.8 and greater ?  (Read 2445 times)

guest58172

  • Guest
[SOLVED] Stop compilation for LCL 1.8 and greater ?
« on: December 18, 2017, 07:26:42 am »
Today i 've been surprised to see that it's not possible. I expected something like

Code: Pascal  [Select][+][-]
  1. {$IFDEF LCL_VERSION>1640}
  2.   {$STOP 'not compatible'}
  3. {$ENDIF}
  4.  

But well, there's nothing like this that works for me

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Stop compilation for LCL 1.8 and greater ?
« Reply #1 on: December 18, 2017, 07:57:23 am »
Does this example not work for you BBasile ?

edit: e.g. something like:
Code: [Select]
{$IF lcl_fullversion>1080006}
  {$STOP 'not compatible'}
{$ENDIF}
« Last Edit: December 18, 2017, 08:08:42 am by molly »

Thaddy

  • Hero Member
  • *****
  • Posts: 14382
  • Sensorship about opinions does not belong here.
Re: Stop compilation for LCL 1.8 and greater ?
« Reply #2 on: December 18, 2017, 08:18:26 am »
Yes, but note you will have to include lclversion:
Code: Pascal  [Select][+][-]
  1. program versioning;
  2. uses lclversion;
  3. begin
  4.   {$IF lcl_fullversion>1060400}
  5.     {$STOP 'not compatible'}
  6.   {$ENDIF}
  7.   writeln(LCL_FULLVERSION);
  8. end.
« Last Edit: December 18, 2017, 08:25:09 am by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

guest58172

  • Guest
Re: Stop compilation for LCL 1.8 and greater ?
« Reply #3 on: December 18, 2017, 08:21:56 am »
Ah yeah this works. If think i've found this solution elsewhere but i trusted the highlighter too much (it always displays the STOP directive semi opaque)

Thaddy

  • Hero Member
  • *****
  • Posts: 14382
  • Sensorship about opinions does not belong here.
Re: Stop compilation for LCL 1.8 and greater ?
« Reply #4 on: December 18, 2017, 08:27:06 am »
Ah yeah this works. If think i've found this solution elsewhere but i trusted the highlighter too much (it always displays the STOP directive semi opaque)

That's because in that case the version is ok. If you try the reverse ( <) the {$STOP} becomes bold...
The ide merely shows you that the condition is not met. (If you ask me, it should be the other way around: bit confusing)
« Last Edit: December 18, 2017, 08:37:23 am by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: [SOLVED] Stop compilation for LCL 1.8 and greater ?
« Reply #5 on: December 18, 2017, 08:35:07 am »
Also note that i've used the latest number so it was visible how the fullversion is constructed. If you would want to 'exclude' all 1.8 release candidates as well use a zero at the end.

Whatever you decide falls into the 1.8 category, is up to yourself  :)

For possible operators see here, as you original question was 1.8 and greater.

guest58172

  • Guest
Re: [SOLVED] Stop compilation for LCL 1.8 and greater ?
« Reply #6 on: December 18, 2017, 02:47:20 pm »
The highlighting clearly doesn't work for IF. The following screenshot is captured on 1.6.4. I'd expect the STOP to be semi opaque, to the extent that this works for other preprocessor constructs (which i admit are certainly easier to evaluate from the highlighter side).

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: [SOLVED] Stop compilation for LCL 1.8 and greater ?
« Reply #7 on: December 18, 2017, 03:02:52 pm »
That is correct BBasile (or actually indeed wrong  :) ).

It was reported in the bug-tracker a while ago edit: it's either this report or one of the other related bugs mentioned that i remembered.
« Last Edit: December 18, 2017, 03:09:34 pm by molly »

 

TinyPortal © 2005-2018