georges pletinckx 0 Posted April 16, 2023 Hello, I don't know if I am at the right place. I installed Delphi and I want to work on an old program. I want to edit a .pas file and i get this on screen (see the attach file). How can I solve this? Thx Share this post Link to post
FPiette 383 Posted April 16, 2023 It looks like you Calcul.pas file is not a Delphi source code. Given we see "EXIF", it is possible that it is a JPG or other image format. If you open Calcul.pas using Notepad, does it display garbage? Share this post Link to post
darnocian 84 Posted April 17, 2023 (edited) That looks like your file system may be corrupted if a .pas is opening that way. Worth looking at a backup (hopefully you have external version control like github). Worth running a chkdsk on your drive and check other sources too that you may rely on. Edited April 17, 2023 by darnocian Share this post Link to post
KodeZwerg 54 Posted April 17, 2023 24 minutes ago, darnocian said: That looks like your file system may be corrupted if a .pas is opening that way. Worth looking at a backup (hopefully you have external version control like github). Worth running a chkdsk on your drive and check other sources too that you may rely on. Nope, by looking at the first four Bytes it really looks like a Jpeg signature, at least they start same way, but why an image file got a .pas extension... ask @georges pletinckx So I hope for him he still got a backup somewhere flying around. Share this post Link to post
FPiette 383 Posted April 17, 2023 1 hour ago, KodeZwerg said: Nope, by looking at the first four Bytes it really looks like a Jpeg signature @KodeZwerg That is basically the same answer as I gave yesterday... He probably got a screen dump of the source code as a jpg image and renamed the file to .pas thinking this is the way to get the actual source code 😄😄😄 Of course it isn't... 1 Share this post Link to post
Roger Cigol 103 Posted April 20, 2023 ... try renaming the file back to .jpg and then try to open it with a photo viewer app and see ! Share this post Link to post
georges pletinckx 0 Posted April 20, 2023 Hello, I used an old version of calcul.pas and I can edit it. Thanks all. Share this post Link to post
FPiette 383 Posted April 20, 2023 @georges pletinckxI'm interested to know if - as I guessed - you had renamed a JPG file to .PAS. Share this post Link to post
georges pletinckx 0 Posted April 20, 2023 Hello, no I didn't because it must be a pas file. I goes to the history ans i bring the last calcul.pas and it's ok Share this post Link to post
FPiette 383 Posted April 20, 2023 1 hour ago, georges pletinckx said: Hello, no I didn't because it must be a pas file. I goes to the history ans i bring the last calcul.pas and it's ok Well, how do you explain that a .PAS file actually contained JPG data? If you have not renamed, you copied a jpg over a pas file. btw: There is no shame to make an error. That's how we learn. Share this post Link to post
georges pletinckx 0 Posted April 20, 2023 I don't explain it. May be I tried to modify it on my Mac. I don't see another reason Share this post Link to post
programmerdelphi2k 237 Posted April 20, 2023 for sure, you "replaced" with your another files in some moment (by mistake, for example), ex. pas with jpeg etc.... Share this post Link to post