Page 1 of 1

IDE to store original PureBasic version

Posted: Fri Sep 11, 2009 8:04 am
by UserOfPure
I just loaded an old source that doesn't compile with v4.31 and I accidentally saved it over itself. Now I don't know which PureBasic version will compile it (well, without a bit of time-consuming investigation). All PureBasic sources have this line in them which indicates which version saved it:

Code: Select all

; IDE Options = PureBasic 4.31 (Windows - x86)
This is good, but how about adding another line something like this too:

Code: Select all

; IDE Options (Original) = PureBasic 4.31 (Windows - x86)
Then what happens is this: whenever the source is saved, if the above (Original) line is present, then do NOT overwrite it, but leave it as-is; and if the above (Original) line is NOT present, then yes, save it along with the other options. This is very easy to add and would take less than 5 minutes of coding to the IDE, and it means we can look at our sources with Notepad and know instantly what version the code was written for. In my case, I could know which version it was for and download that from the PureBasic Museum to get it running again, without the need to start porting the entire code to v4.31 or later.

Re: IDE to store original PureBasic version

Posted: Fri Sep 11, 2009 8:33 am
by blueznl
In itself the idea is good, but I'd rather have a n otpional warning fore load and / or save.

Something along these lines... when loading:

- Warning: this code was created for PB vx.xx.

That would alert the user he / she is loading code from an older version.

As for saving... I dunno :-) It might cause havoc with other tools. I'd stick to the warning on load.

Re: IDE to store original PureBasic version

Posted: Fri Sep 11, 2009 8:55 am
by UserOfPure
blueznl wrote:Something along these lines... when loading:
- Warning: this code was created for PB vx.xx.
Yes, I like that idea better. Team: please do it for v4.40 as it's very easy to add.

Re: IDE to store original PureBasic version

Posted: Fri Sep 11, 2009 11:26 am
by eesau
This feature would be confusing, as none of the old sources would have that line in their header. So when PB 4.50 comes out, the IDE would give a warning for sources made with 4.40 but not for sources made with pre-4.40 versions. That would just lead to confusion.

Re: IDE to store original PureBasic version

Posted: Fri Sep 11, 2009 12:23 pm
by UserOfPure
Huh? There'd be no confusion at all. All the old sources still have their original version numbers in them. It's always been that way. I don't understand what you think the problem is.

Re: IDE to store original PureBasic version

Posted: Fri Sep 11, 2009 12:37 pm
by eesau
Hah, I totally misunderstood the request :) Time for sleep maybe?

Re: IDE to store original PureBasic version

Posted: Fri Sep 11, 2009 12:53 pm
by luis
UserOfPure wrote:I just loaded an old source that doesn't compile with v4.31 and I accidentally saved it over itself. Now I don't know which PureBasic version will compile it (well, without a bit of time-consuming investigation).
Personally I don't like this request very much, it would be another "would you like to do so ?" question I don't feel the need of.

When I want to know what version of PB I used to compile a source, I simply add a comment on the top of the source, stating the version used.

Re: IDE to store original PureBasic version

Posted: Fri Sep 11, 2009 1:02 pm
by blueznl
Well, I think it would definitely serve the PBdevs and the community, as it would avoid many questions about newcomers trying older code they find on the forum or the web.

On top of that, I chose the word 'optional' :-) A little tick box in the editor preferences should allow you to disable this warming.

I think it's a seriously good idea, the more I think about it.

Re: IDE to store original PureBasic version

Posted: Fri Sep 11, 2009 1:12 pm
by UserOfPure
luis wrote:Personally I don't like this request very much
What I requested it totally uninstrusive and disturbs nobody, and affects nothing. No warnings, no need for prompts, and so on. Just a permanent record at the end of the file that shows the first version used to compile it. There are zero downsides to it.
blueznl wrote:Well, I think it would definitely serve the PBdevs and the community, as it would avoid many questions about newcomers trying older code they find on the forum or the web.
It won't work on code in the forum because such code has no IDE info with it. ;)

Re: IDE to store original PureBasic version

Posted: Fri Sep 11, 2009 1:50 pm
by luis
UserOfPure wrote: What I requested it totally uninstrusive and disturbs nobody, and affects nothing. No warnings, no need for prompts, and so on.
Just a few lines above you said:
UserOfPure wrote:
blueznl wrote:Something along these lines... when loading:
- Warning: this code was created for PB vx.xx.
Yes, I like that idea better. Team: please do it for v4.40 as it's very easy to add.
To me sound like you agree with the warning.

Now if you changed your mind again and you are back to your original idea, that's ok but I'm not psychic.
UserOfPure wrote: Just a permanent record at the end of the file that shows the first version used to compile it. There are zero downsides to it.
Assuming the warning is gone again, there will be only another line at the end of file containing a info I don't care about.

Anyway, it's not my decision, but I like to have my opinion about it. I don't feel the need for it.
UserOfPure wrote:
blueznl wrote:Well, I think it would definitely serve the PBdevs and the community, as it would avoid many questions about newcomers trying older code they find on the forum or the web.
It won't work on code in the forum because such code has no IDE info with it. ;)
Yes, thank you for pointing that out.

By the way the rem at the top of code posted in the forum (if people would take the good habit to add it), would be there forever.