Recent

Author Topic: [SOLVED] Howto use a DEFINE present in an installed package  (Read 5078 times)

MarkMLl

  • Hero Member
  • *****
  • Posts: 8132
Re: Howto use a DEFINE present in an installed package
« Reply #15 on: December 02, 2024, 04:07:21 pm »
The syntax highlighter and the compiler can differ in opinion. Make sure you test it by running a compiled binary and printing or logging the result.

I was tempted to point that out: different programs, different projects, different developers...

However more important is consideration of the compiler mode.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

tintinux

  • Sr. Member
  • ****
  • Posts: 353
    • Gestinux
Re: Howto use a DEFINE present in an installed package
« Reply #16 on: December 02, 2024, 04:55:13 pm »
The syntax highlighter and the compiler can differ in opinion. Make sure you test it by running a compiled binary and printing or logging the result.

Ah, when compiling, it is OK...
The syntax highlighter was wrong.
Thanks to all.
« Last Edit: December 02, 2024, 04:58:12 pm by tintinux »
Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5815
  • Compiler Developer
Re: Howto use a DEFINE present in an installed package
« Reply #17 on: December 03, 2024, 09:42:38 pm »
Depends on the mode.

Quote
The content of an expression is restricted to what can be evaluated at compile-time:

*    Constants (strings, numbers)
*    Macros
*    Compile time variables (mode MacPas only)
*    Pascal constant expressions (mode Delphi only) <=====

That should be updated, cause the only mode where Pascal constant expressions are not supported/enabled is mode MacPas. All other modes allow them.

https://www.freepascal.org/docs.html -> Programmer's Guide detailed discussion of $IF. It's safest that I don't put in a URL for that since there's no guarantee that if will remain consistent over different versions of the compiler.

You could have at least mentioned the title of the section however, this way one doesn't need to guess where exactly you found it...

MarkMLl

  • Hero Member
  • *****
  • Posts: 8132
Re: Howto use a DEFINE present in an installed package
« Reply #18 on: December 04, 2024, 09:43:08 pm »
You could have at least mentioned the title of the section however, this way one doesn't need to guess where exactly you found it...

Wearing my technical writer's hat: I agree in principle, but the problem is that section header text (not to mention URLs derived from it) can be very easily broken.

On the "teach a man to fish" principle, in this context I think it's more useful to highlight the documentation root- which a lot of people overlook in favour of the wiki- plus some brief hints on how to use it.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

PascalDragon

  • Hero Member
  • *****
  • Posts: 5815
  • Compiler Developer
Re: Howto use a DEFINE present in an installed package
« Reply #19 on: December 05, 2024, 08:59:54 pm »
You could have at least mentioned the title of the section however, this way one doesn't need to guess where exactly you found it...

Wearing my technical writer's hat: I agree in principle, but the problem is that section header text (not to mention URLs derived from it) can be very easily broken.

It would have nevertheless allowed to look it up right now instead of having to search it which costs time that can be spend better.

bytebites

  • Hero Member
  • *****
  • Posts: 694
Re: [SOLVED] Howto use a DEFINE present in an installed package
« Reply #20 on: December 06, 2024, 12:05:01 am »

 

TinyPortal © 2005-2018