name giving fault by making .exe file.

Working on new editor enhancements?
wimapon
Enthusiast
Enthusiast
Posts: 290
Joined: Thu Dec 16, 2010 2:05 pm
Location: Delfzijl ( The Netherlands )
Contact:

name giving fault by making .exe file.

Post by wimapon »

I have a problem with the name giving when i compile a .exe file.
I make a program. Compile and Run it a few times, change it, compile again etc.
Sometime i change the name with "save as" prog1.pb prog2.pb prog3.pb
than i make a .exe file and i get the wrong name... like prog1.exe
How can i get the last name? In this case prog3.exe???

Wim
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: name giving fault by making .exe file.

Post by IdeasVacuum »

Hello Wim

http://www.professorcad.co.uk/pb_stuff/WimSaveExe.zip

A tiny movie showing how to do it.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
wimapon
Enthusiast
Enthusiast
Posts: 290
Joined: Thu Dec 16, 2010 2:05 pm
Location: Delfzijl ( The Netherlands )
Contact:

Re: name giving fault by making .exe file.

Post by wimapon »

Hello Ideasvacuum,
Yes.. splended show...

But i mean,, getting the last name, but without any typing...
i normally forget that, and then i overwrite an earlier version...
Wim
User avatar
Vera
Addict
Addict
Posts: 858
Joined: Tue Aug 11, 2009 1:56 pm
Location: Essen (Germany)

Re: name giving fault by making .exe file.

Post by Vera »

Hello

I do have a similar 'problem' as I could never find out where you assign the name of the exe.

It says that the compiler options are saved within the sourcecode - ok - but I do have sourcecodes with a setting line like: ; Executable = NAME.exe.
This code will automatically lead to suggest NAME.exe when creating the executable.

Now I would like to apply this 'feature' to my own applications, but I cannot find where it has to be assigned in the IDE. If I search all settings (prefs and compiler options) there's no input field to write it in. Likewise I can't detect the according settings of the first mentioned sourcecode (including: Executable... ) anywhere.

Also: if I give a NAME the first time I'd create an exe this would not be noted in the code as well.

One dosn't have to assing it in the sourcecode manually ? Is there an extra tool needed ?


@ wimapon
If your code settings of 'prog1.pb' already includes "Executable = prog1.exe" then this will be copied into prog3.pb as well. So it's clear that when creating an exe with prog3.pb it'll suggest 'prog1.exe'.

You would need to change this setting as well if you know where to do do it. As least manually in the sourcecode ;)

greetings ~ Vera

edit: applied forgotten '='
Last edited by Vera on Mon Jan 24, 2011 3:36 pm, edited 1 time in total.
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: name giving fault by making .exe file.

Post by IdeasVacuum »

Some of the IDE Compiler Options (not including the exe name) are appended to the end of the source code, but the PB IDE does not reveal them. If you load the PB file into another editor, then you can see them. Perhaps a good enhancement would be to (a) reveal the settings in PB and (b) include the exe name as a Compiler option.

I have not seen a Source Code with a setting line like ; Executable NAME.exe so I tried adding that to the appended lines myself, then re-loading the file into the IDE. Didn't work. So, as Vera says, it's a mystery as to where PB stores the exe name.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Vera
Addict
Addict
Posts: 858
Joined: Tue Aug 11, 2009 1:56 pm
Location: Essen (Germany)

Re: name giving fault by making .exe file.

Post by Vera »

Hi IdeasVacuum,

sorry - I forgot the '=' - writing it down from remembrance :?

on WIN: ; Executable = name.exe
on Linux: ; Executable = name

hopefully someone dropes in to clarify how this is set, where the knowledge is from :wink: and if there are even further helpfull preferences.

Vera
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: name giving fault by making .exe file.

Post by IdeasVacuum »

Ah yes Vera, so it does work. Surely someone out there knows how to get the IDE to put it there................
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
wimapon
Enthusiast
Enthusiast
Posts: 290
Joined: Thu Dec 16, 2010 2:05 pm
Location: Delfzijl ( The Netherlands )
Contact:

Re: name giving fault by making .exe file.

Post by wimapon »

Hi Vera and IdeasVacuum,
As a PB-dummy i do not understand what you are talking about.. but i understand
that i have to live with this problem....right?

Wim
Marlin
Enthusiast
Enthusiast
Posts: 406
Joined: Sun Sep 17, 2006 1:24 pm
Location: Germany

Re: name giving fault by making .exe file.

Post by Marlin »

wimapon wrote:that i have to live with this problem....right?
I think, you can change it, if you really want.

However, you probably need to figure out and create the solution yourself.

I believe you can get what you want, using external tools.
You can create them yourself using f.e. PB executables ...

Look at the IDEs menu item Tools/Configure Tools...
Better read the help about the IDE as well!

I think, in your case the trigger "Sourcecode saved" might be the right one,
or perhaps "before create executable".

Such an event then could start your tool.
This could then do the required preparations...

As I understood it, this "; Executable = name.exe" entry is just the place,
where the last path and name you used is stored, so that it can be found to suggest
the path and name, next time you create the executable.
I usually do use the same path and name, when I create an executable.
(Except when switching OSes)

If you use a project to manage your ... well project, ;-)
there actually are input fields at the compiler options,
where you can enter path and name for the output executables
for each compile target.
In that case, this information would be stored somewhere in the project file!

I recommend, not to be fixated too much on one solution
as there might be other even better possibilities to reach your overall goals...
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: name giving fault by making .exe file.

Post by Trond »

When you use Create Executable, the file name you input before clicking ok is stored in the current source file (as executable = filename.exe). The next time you use create executable from the same source file, the IDE will suggest the stored filename from last time (exception: if you don't save the source file after create executable, it is not remembered).
User avatar
Vera
Addict
Addict
Posts: 858
Joined: Tue Aug 11, 2009 1:56 pm
Location: Essen (Germany)

Re: name giving fault by making .exe file.

Post by Vera »

Hello wimapon,

I'll try to explain what our talking is about.

1. open a new tab in the IDE and put in your code
2a there are already basic settings in the preferences (e.g: enable debugger, create unicode executable ...)
2b you apply current settings like e.g. EnableXP, use different compiler ...
3. save this file and several of these settings will be appended into the source code
4. open the source-code with (e.g.) notepad and you find'll something like this at the end of the file:

Code: Select all

; IDE Options = PureBasic 4.50 (Windows - x86)
; CursorPosition = 14
; FirstLine = 23
; Folding = ---
; DisableDebugger
; EnableXP
; Executable = NAME-1.exe
; CommandLine = ""
Now - if you copy any code1.pb to code2.pb these settings will be copied as well.
(It's the same as saving the current code under a new name.)

In case that line ; Executable = NAME-1.exe already existed it will also be copied. Now when creating an exe with the new (copied) code file it will use this setting and keep suggesting NAME-1.exe to you.



@ Trond

big thanks :)

(exception: if you don't save the source file after create executable, it is not remembered)

that was the factor I didn't know and why naming or renaming never worked so I just stopped bothering and simply kept renaming the compilation-outputs manually.

cheers ~ Vera
wimapon
Enthusiast
Enthusiast
Posts: 290
Joined: Thu Dec 16, 2010 2:05 pm
Location: Delfzijl ( The Netherlands )
Contact:

Re: name giving fault by making .exe file.

Post by wimapon »

Okee folks,
i see what happens.

First make an exacutable and then save puts the new name in the source code.

Pitty. It should be the other way around..... first saving and then putting the new name
in the source code.. than making the executable will use the right name.

But,i can live with that.. a matter of paying good attention on the name while
making an executable.

Many thanks.

wim
Post Reply