Recent

Author Topic: How to load the content of a text file in a String Constant in compile time?  (Read 10395 times)

molly

  • Hero Member
  • *****
  • Posts: 2330
I'm 100% pure the problem exists.
That is because the problem that is (if there even is any) is between the ears (yours, not mine ;-p)

Quote
Seems you do a full rebuild every time (-B option); that forces the compiler to also recompile the resource script and in that specific situation you will not 'experience the behaviour'.
Of course.

That is normal behaviour of a compiler. Compilation will compile your .pas files (if there is reason for the compiler to do so). The build option forces the compiler to build those files part of your project so that it is able/forced to create a new .exe.

That is also reason why you need to change the source-code in case you made changes inside an include file. It simply isn't part of the compilation process to check if contents of an include file was changed or not.

Besides that, i fail to understand why building a project, instead of compiling is such a big hassle.

If a project in development suffers from building, then imho you misundertood the idea behind resources.

The moment resources keep changing you need to find yourself a faster/better way to accomodate. It's a simple one liner to load the same data directly from file. The moment development settles down (at least the changing of the script) you add the (static) resource to your project. In case you need the resource(s) to be changed afterwards, then don't use internal resources but use an external solution, such as a resource blob. Many games uses this solution to allow game content to be added/changed after (initial) release.

And to be clear. No i do not _always_ buid my project. Normally i compile. Only when resources changed or other changes were made that requires a build, i do a new build as shown.

I have no idea how Lazarus solves this. Compilation seems enough for lazarus to see that the original file included in the resource was changed and act accordingly.

eny

  • Hero Member
  • *****
  • Posts: 1634
I'm 100% pure the problem exists.
That is because the problem that is (if there even is any) is between the ears (yours, not mine ;-p)

Quote
Seems you do a full rebuild every time (-B option); that forces the compiler to also recompile the resource script and in that specific situation you will not 'experience the behaviour'.
Of course.

That is normal behaviour of a compiler. Compilation will compile your .pas files (if there is reason for the compiler to do so). The build option forces the compiler to build those files part of your project so that it is able/forced to create a new .exe.

That is also reason why you need to change the source-code in case you made changes inside an include file. It simply isn't part of the compilation process to check if contents of an include file was changed or not.

Besides that, i fail to understand why building a project, instead of compiling is such a big hassle.

If a project in development suffers from building, then imho you misundertood the idea behind resources.

The moment resources keep changing you need to find yourself a faster/better way to accomodate. It's a simple one liner to load the same data directly from file. The moment development settles down (at least the changing of the script) you add the (static) resource to your project. In case you need the resource(s) to be changed afterwards, then don't use internal resources but use an external solution, such as a resource blob. Many games uses this solution to allow game content to be added/changed after (initial) release.

And to be clear. No i do not _always_ buid my project. Normally i compile. Only when resources changed or other changes were made that requires a build, i do a new build as shown.

I have no idea how Lazarus solves this. Compilation seems enough for lazarus to see that the original file included in the resource was changed and act accordingly.
And we have another blogger in the forum...
Your opinion does not help TS in any way unfortunately.
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

molly

  • Hero Member
  • *****
  • Posts: 2330
I'm 100% pure the problem exists.
That is because the problem that is (if there even is any) is between the ears (yours, not mine ;-p)

Quote
Seems you do a full rebuild every time (-B option); that forces the compiler to also recompile the resource script and in that specific situation you will not 'experience the behaviour'.
Of course.

That is normal behaviour of a compiler. Compilation will compile your .pas files (if there is reason for the compiler to do so). The build option forces the compiler to build those files part of your project so that it is able/forced to create a new .exe.

That is also reason why you need to change the source-code in case you made changes inside an include file. It simply isn't part of the compilation process to check if contents of an include file was changed or not.

Besides that, i fail to understand why building a project, instead of compiling is such a big hassle.

If a project in development suffers from building, then imho you misundertood the idea behind resources.

The moment resources keep changing you need to find yourself a faster/better way to accomodate. It's a simple one liner to load the same data directly from file. The moment development settles down (at least the changing of the script) you add the (static) resource to your project. In case you need the resource(s) to be changed afterwards, then don't use internal resources but use an external solution, such as a resource blob. Many games uses this solution to allow game content to be added/changed after (initial) release.

And to be clear. No i do not _always_ buid my project. Normally i compile. Only when resources changed or other changes were made that requires a build, i do a new build as shown.

I have no idea how Lazarus solves this. Compilation seems enough for lazarus to see that the original file included in the resource was changed and act accordingly.
And we have another blogger in the forum...
Your opinion does not help TS in any way unfortunately.
Ah, but it looked like you had so much fun playing with yourself single-handedly that i thought you could perhaps use that circular motion to your advantage. Seems i was wrong 'bout that, sorry.

 

TinyPortal © 2005-2018