Add Option to Suppress PB Settings in Configure Tools Window
Add Option to Suppress PB Settings in Configure Tools Window
In the 'Edit Tool Settings' dialogue window reached from the IDE menupath Tools -> Configure Tools, please add a checkbox to omit the 'PB settings lines' from the temporary source file. This will make it much easier to append additional lines to source files or to merge source files.
The 'PB settings lines, are those hidden lines that optionally can be at the end of a source file. The first such line commences: "; IDE Options = PureBasic".
Alternatively, introduce a new variable called [say] %SOURCESIZE that returns the number of bytes in the temporary source file just before the start of any hidden lines.
The 'PB settings lines, are those hidden lines that optionally can be at the end of a source file. The first such line commences: "; IDE Options = PureBasic".
Alternatively, introduce a new variable called [say] %SOURCESIZE that returns the number of bytes in the temporary source file just before the start of any hidden lines.
Last edited by akj on Sun Aug 23, 2009 1:14 pm, edited 1 time in total.
Anthony Jordan
-
- Enthusiast
- Posts: 469
- Joined: Sun Mar 16, 2008 9:18 am
Re: Add Option to Suppress PB Settings in Configure Tools Wi
It's the "Save Settings As" option in the Preferences. It already does what you want.
@UserOfPure:
[As a result of your post, I have slightly edited my original post.]
You have misunderstood my wishes.
I want to retain the ability to have the PB settings at the end of my true source file, but I want an option for them to be supressed (or a variable to determine their start position) in the temporary file that is accessible via %TEMPFILE .
[As a result of your post, I have slightly edited my original post.]
You have misunderstood my wishes.
I want to retain the ability to have the PB settings at the end of my true source file, but I want an option for them to be supressed (or a variable to determine their start position) in the temporary file that is accessible via %TEMPFILE .
Anthony Jordan
-
- Enthusiast
- Posts: 469
- Joined: Sun Mar 16, 2008 9:18 am
If you select "The file <filename>.pb.cfg" then you will be able to merge several source codes without worrying about the config settings, which is what you said above, yes? They will be omitted with the above preference, and just called instead from a separate ".cfg" file.AKJ wrote:omit the 'PB settings lines' from the temporary source file. This will make it much easier to append additional lines to source files or to merge source files.
Tempfiles always have the settings appended so tools can read them regardless of where the IDE stores these settings for normal sources.
I don't see the problem really. Why can't you just look for the line that starts the settings and cut the rest when you merge files ?
I don't see the problem really. Why can't you just look for the line that starts the settings and cut the rest when you merge files ?
quidquid Latine dictum sit altum videtur
@freak:
You ask as being part of PB internals and so subject to arbitrary change over time, thus invalidating any dependent programs in the long-term.
And you frequently say we should not rely on PB internals information.
You ask
I certainly can do what you suggest, BUT I regard lines likeWhy can't you just look for the line that starts the settings and cut the rest when you merge files ?
Code: Select all
"; IDE Options = PureBasic ..."
And you frequently say we should not rely on PB internals information.
Anthony Jordan
Euh, I may be stupid, but aren't these for the IDE only? The temp file is passed on to the compiler, so why care about the comments? I'm a bit lost here 

( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
@blueznl:
In the context of my original post, the temp file is not being passed to the compiler. The compiler is totally irrelevant.
I am intercepting and modifying the temp file in an external tool I have written [one that uses the %TEMPFILE variable]. This tool is accessed from the IDE menupath Tools.
In the context of my original post, the temp file is not being passed to the compiler. The compiler is totally irrelevant.
I am intercepting and modifying the temp file in an external tool I have written [one that uses the %TEMPFILE variable]. This tool is accessed from the IDE menupath Tools.
Anthony Jordan
I'm doing a similar thing in CodeCaddy, but I don't understand why you're worried about those comment lines at the end. Are you going to manipulate the source in such a way they are no longer applicable?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
@Mistrel & blueznl:
I have managed to work-around the PB settings problem by hard-coding the string "; IDE Options = PureBasic" within my program. But this seems kludgy as it effectively uses information which is in the realm of undocumented internals information and I felt there should be a more robust way of doing it, especially one that does not require reading the entire source code, purely to find the start of the PB settings. Hence my original post.
Blueznl asks
My program is a simple tool that appends to the end of the current PB source program a non-PB text file, usually code written in another language such as C or VB. However every non-empty line of the incoming text file is commented out preventing PB from case-correcting the text [and awkward characters such as tabs are removed or replaced]. This facilitates translating the foreign code to PB, which is usually my goal.
If I ignore the PB settings lines and simply append after them, they act as a barrier, hiding the appended text, thus I must move or remove them.
Mistrel, you mention creative work-arounds. Do you have any in mind that are unusual or particularly interesting?
I have managed to work-around the PB settings problem by hard-coding the string "; IDE Options = PureBasic" within my program. But this seems kludgy as it effectively uses information which is in the realm of undocumented internals information and I felt there should be a more robust way of doing it, especially one that does not require reading the entire source code, purely to find the start of the PB settings. Hence my original post.
Blueznl asks
and the answer is Yes.Are you going to manipulate the source in such a way they are no longer applicable?
My program is a simple tool that appends to the end of the current PB source program a non-PB text file, usually code written in another language such as C or VB. However every non-empty line of the incoming text file is commented out preventing PB from case-correcting the text [and awkward characters such as tabs are removed or replaced]. This facilitates translating the foreign code to PB, which is usually my goal.
If I ignore the PB settings lines and simply append after them, they act as a barrier, hiding the appended text, thus I must move or remove them.
Mistrel, you mention creative work-arounds. Do you have any in mind that are unusual or particularly interesting?
Anthony Jordan
@Mistrel:
I understand your reply but there are two advantages in having foreign text imported as comments:
1. Automatic case changing does not occur.
2. It's easier to distinguish between the imported text, and my own PB code.
This is especially true as the each line of imported text is prepended with two semi-colons, so distinguishing it from normal PB comments.
I understand your reply but there are two advantages in having foreign text imported as comments:
1. Automatic case changing does not occur.
2. It's easier to distinguish between the imported text, and my own PB code.
This is especially true as the each line of imported text is prepended with two semi-colons, so distinguishing it from normal PB comments.
Anthony Jordan