Recent

Author Topic: [Solved/nvm] Compiler: get string passed from project  (Read 1120 times)

Thaddy

  • Hero Member
  • *****
  • Posts: 17159
  • Ceterum censeo Trump esse delendam
Re: Compiler: get string passed from project
« Reply #15 on: May 01, 2025, 04:29:33 pm »
I just improved it, reading Paramstr. Posts crossed.
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

Fibonacci

  • Hero Member
  • *****
  • Posts: 754
  • Internal Error Hunter
Re: Compiler: get string passed from project
« Reply #16 on: May 01, 2025, 04:31:00 pm »
I just improved it, reading Paramstr. Posts crossed.

You still dont get it? Its about passing a string to the compiler. Notice the version string on the screenshot.

Thaddy

  • Hero Member
  • *****
  • Posts: 17159
  • Ceterum censeo Trump esse delendam
Re: Compiler: get string passed from project
« Reply #17 on: May 01, 2025, 04:37:29 pm »
Change the compiler source to add the ability to pass any string (not predefined in the compiler source). Then strings can only be set inside the source code of the user program. Available only during compilation, for the compiler, to change its behavior per project/compiled file.
But that is what I demo'd: You can pass an option through the commandline and is evaluated at compile time.
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

Fibonacci

  • Hero Member
  • *****
  • Posts: 754
  • Internal Error Hunter
Re: Compiler: get string passed from project
« Reply #18 on: May 01, 2025, 04:46:51 pm »
But that is what I demo'd: You can pass an option through the commandline and is evaluated at compile time.

The option in the form of string should be passed to the compiler for it to behave appropriately. In the example I showed the behavior is to append the string to the version string that is written to the binary output. The actual program source code has nothing to do with it.

Thaddy

  • Hero Member
  • *****
  • Posts: 17159
  • Ceterum censeo Trump esse delendam
Re: [Solved/nvm] Compiler: get string passed from project
« Reply #19 on: May 01, 2025, 05:51:30 pm »
That is what version.inc does. I don't see the point. All you need to do is edit version.inc
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

Fibonacci

  • Hero Member
  • *****
  • Posts: 754
  • Internal Error Hunter
Re: [Solved/nvm] Compiler: get string passed from project
« Reply #20 on: May 01, 2025, 06:00:31 pm »
You must be doing this on purpose :D Version is just a stupid example of use. Also, no, you cant change the version string per project. Create 10 projects and use different appendix in each.

Forget the version thing. I am creating a custom PE section and I want to pass the name of the section. I have 50 .pas files, each one needs to be compiled with different PE section name. Remember: the compiler is modified to create this section, only the name of it is needed to be set per each .pas file.

Thaddy

  • Hero Member
  • *****
  • Posts: 17159
  • Ceterum censeo Trump esse delendam
Re: [Solved/nvm] Compiler: get string passed from project
« Reply #21 on: May 02, 2025, 03:30:35 pm »
Pointless if it is already there in more than one guile.
I would un-patch it.(that's just being grumpy)
Then again, I wrote some patches over the last decades and some of them got refused too.... Not many.
I appreciate the effort, but in my opinion.... not necessary.
« Last Edit: May 02, 2025, 03:36:48 pm by Thaddy »
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

 

TinyPortal © 2005-2018