Problem while opening .pb File

Working on new editor enhancements?
User avatar
thyphoon
Enthusiast
Enthusiast
Posts: 355
Joined: Sat Dec 25, 2004 2:37 pm

Problem while opening .pb File

Post by thyphoon »

Hello

Excuse me for my bad english.
I have a little problem with the last beta version. Some Pb file are empty when i open it with IDE !
You can try to download this http://yann.lebrun.club.fr/Aliens.zip
try to open "main.pb" (6ko) with purebasic IDE, The file is empty. but if you open it with notepad you can see the code.
I think it's a bug ! can you comfirm it to me ?
best regards

Thyphoon
Derek
Addict
Addict
Posts: 2354
Joined: Wed Apr 07, 2004 12:51 am
Location: England

Post by Derek »

Confirmed. However, if you edit it in notepad and make even a slight change (add a space to the end of a line) and save it then it opens ok in the editor.
User avatar
thyphoon
Enthusiast
Enthusiast
Posts: 355
Joined: Sat Dec 25, 2004 2:37 pm

Post by thyphoon »

Derek wrote:Confirmed. However, if you edit it in notepad and make even a slight change (add a space to the end of a line) and save it then it opens ok in the editor.
Thanks for this information Comtois on the french forum give me the same information.
maw

Post by maw »

Actually it's the source that is broken. The first character in the source is $00...
User avatar
thyphoon
Enthusiast
Enthusiast
Posts: 355
Joined: Sat Dec 25, 2004 2:37 pm

Post by thyphoon »

maw wrote:Actually it's the source that is broken. The first character in the source is $00...
yes it's curious ! i have no touch my code since many month, and the list time it should be ok ! thanks
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Broken source? Slight change?

BUG! :!:

EDIT: If the file is broken (i.e. the PB editor DOES NOT admit not printable characters), then it should not admit never. AND if PB editor DOES admit not printable characters, then it should admit always.

So then, a bug as big as a tower! :shock:
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
maw

Post by maw »

What are you talking about? The editor should not handle binary files. It doesn't. That is not a bug. The fact that it has handled it in the past doesn't mean it should continue to do it. It just means they now have fixed the bug that did allow binary files.

And a bug as big as a tower? Come on! If the editor started to erase files on your computer, that would be a big bug. This is just a minor glitch.
Last edited by maw on Sat Oct 13, 2007 9:14 pm, edited 1 time in total.
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Please read above the words of Derek:
if you edit it in notepad and make even a slight change (add a space to the end of a line) and save it then it opens ok in the editor.
, then do it, and then think :wink:
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
maw

Post by maw »

Psychophanta wrote:Please read above the words of Derek:
if you edit it in notepad and make even a slight change (add a space to the end of a line) and save it then it opens ok in the editor.
, then do it, and then think :wink:
Well, if you edit it in notepad then notepad simply removes the $00 character when it saves it. What's that got to do with it?
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

maw wrote:Well, if you edit it in notepad then notepad simply removes the $00 character when it saves it. What's that got to do with it?
Wrong, because i edited it in hex mode using hex editor, which does not remove the $00 character, :wink:

EDIT: Arrrrrgh! my mystake. My hex editor is a crap which removes the first $00 chars.

:oops: Looks like no bug ATM :?
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
maw

Post by maw »

Psychophanta wrote:
maw wrote:Well, if you edit it in notepad then notepad simply removes the $00 character when it saves it. What's that got to do with it?
Wrong, because i edited it in hex mode using hex editor, which does not remove the $00 character, :wink:
You have lost me completly.. You say it's a bug. Then you refer to Dereks post about Notepad. Then you say wrong when I explain why Notepad would correct such a character and say you opened it with a hex editor???

EDIT: Now we are talking the same language! No bug!
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

HAAAH! you are right, too little time to change affirmations :? :lol:
Well, i opened it with a very wierd hex editor and inserted a space char after the 1st line, but the editor modified the $00 char by a $20 char :shock:
I have just now uninstalled that hex editor and will install ultraedit again :evil:

OH! my words have now less value than before :roll:
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Derek
Addict
Addict
Posts: 2354
Joined: Wed Apr 07, 2004 12:51 am
Location: England

Post by Derek »

But how did the $00 get in the file in the first place, was it saved from a previous PB editor which inserted it or from some other editor.

If it was from a previous PB editor then there could be other files just waiting to go wrong!
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

I asked myself the same.
Anyway, there should be good if PB editor warned when a source like that is loaded and eventually fix it (instead of keep silence and not to load the source).
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
freak
PureBasic Team
PureBasic Team
Posts: 5941
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

The IDE originaly displayed any file that contained non-printable characters inside
the internal hex-viewer only. I had to change this after i got tons
of "bugreports" from jaPBe users, because the IDE did not load their sources.

The reason is that jaPBe places a NULL character between the code and the
options it appends to the end of the sourcefile.
(The original PB IDE did that as well in old versions, but we removed this because it is not a good
practise and only leads to trouble with other editors, as we can see here.)

Anyway, i contacted GPI (author if jaPBe) and asked him to change this behavior.
The answer i got was something along the lines of "i know this is a bad practise, but
it works for me, and right now i am too lazy to change this".

So i had the choise: piss off a lot of users because of a problem i did not create
(but get all the blame because my editor is the one that does not load the file),
or relax the binary detection routine a bit to let the files slip through.
Funny enough, Scintilla works on null-terminated strings and therefore cuts this file at the null.

There you have your "bug as big as a tower". Maybe a little less drama would have been better...
quidquid Latine dictum sit altum videtur
Post Reply