Page 6 of 8

Re: HMG 3.0.40

Posted: Thu Jan 05, 2012 7:13 pm
by mol
esgici wrote:Hi Marek
mol wrote:... and you need compile project few times one by one.
Moreover we have a Reset Project Incremental Data option in the project menu.
By this way we can do a non-incremental build whenever we need, even was set inc=yes.

Regards

--

Esgici
I always reset incremental build while creating development version...

Re: HMG 3.0.40

Posted: Thu Jan 05, 2012 7:34 pm
by Pablo César
Hellow dear Esgici, I am okay, thanks.
GetStartUpFolder() function Returns The Application Startup Folder Path
And this is it used for what ?

Yes, my expectations was totally different, because this function in my opinion is the same like GetCurrentFolder() returns.

I would like to know where folder Startup in order to simulate an autoexec executable file. Here in this brazilian site was a wrong definitions about GetStartUpFolder() or let me make another question: is it probably missundertood goal function in releases in the past ?

Re: HMG 3.0.40

Posted: Thu Jan 05, 2012 10:34 pm
by esgici
Hola Pablo

If I understood right, you are expecting System Start Up Folder name by this function. If this correct, in Windows ( and DOS surely) System Start Up Folder is always C:\, right ? So it's unnecessary a function for this info. If your expectation is different please inform us.

In other hand,
Pablo César wrote:And this is it used for what ?]
This is for learning starting folder of application !
Pablo César wrote:..this function in my opinion is the same like GetCurrentFolder() returns.
Not always ;)

This is true if executable and other file(s) are in same folder; otherwise, that is executable and other file(s) are in different folders, this function doesn't return same value like GetCurrentFolder().

In windows, every short-way ( .lnk) file have two directory info: Target (Folder) and Starting Location (folder). Target is application start up and starting is working or current folder.

Say, we have an executable in c:\temp and data for use is in d:\temp; c:\temp is start up and d:\temp is current folder.

I hope that I can explain just and this will be useful for you.

Saludos

--

Esgici

Re: HMG 3.0.40

Posted: Fri Jan 06, 2012 11:25 am
by mol
Be careful about incremental building!

I've lost some time to search an error - I've changed some definition in .FMG file (via IDE) - but - module loading this form was not changed, so whole application has not been rebuilt!!!

Best regards, Marek

Re: HMG 3.0.40

Posted: Fri Jan 06, 2012 4:39 pm
by esgici
mol wrote:Be careful about incremental building!
I've lost some time to search an error - I've changed some definition in .FMG file (via IDE) - but - module loading this form was not changed, so whole application has not been rebuilt!!!
Hi Marek

You are right ;

This is because IDE ( and buildxxx.bat files ) use HBMK2 for build process entirely. HBMK2 is really a wonderful tool, but LOAD WINDOW isn't standard Harbour command :(

Regarding my experience, changes on included files via #include directive to source package are counted in build process, but those via SET PROCEDURE TO ... command no :(

However, when a source file other than .prg changed, we don't have make a non-incremental build; re-save ( even not changed ) the .prg
file that include ( whatever via LOAD WINDOW, #include, SET PROC TO ) this non-prg file, may be sufficient, I think.

Regards

--

Esgici

Re: HMG 3.0.40

Posted: Fri Jan 06, 2012 4:52 pm
by mol
esgici wrote:
mol wrote:Be careful about incremental building!
I've lost some time to search an error - I've changed some definition in .FMG file (via IDE) - but - module loading this form was not changed, so whole application has not been rebuilt!!!
Hi Marek

You are right ;

This is because IDE ( and buildxxx.bat files ) use HBMK2 for build process entirely. HBMK2 is really a wonderful tool, but LOAD WINDOW isn't standard Harbour command :(

Regarding my experience, changes on included files via #include directive to source package are counted in build process, but those via SET PROCEDURE TO ... command no :(

However, when a source file other than .prg changed, we don't have make a non-incremental build; re-save ( even not changed ) the .prg
file that include ( whatever via LOAD WINDOW, #include, SET PROC TO ) this non-prg file, may be sufficient, I think.

Regards

--

Esgici
Everything is OK, when your remember about it :)

Re: HMG 3.0.40

Posted: Fri Jan 06, 2012 4:58 pm
by esgici
mol wrote: Everything is OK, when your remember about it :)
Again, you are right :)

If you are concerned on big jobs, you have thinking big ;)

Regards

--

Esgici

Re: HMG 3.0.40

Posted: Fri Jan 06, 2012 7:22 pm
by Pablo César
Sorry dear Esgici for my delayed return.
esgici wrote:If I understood right, you are expecting System Start Up Folder name by this function. If this correct, in Windows ( and DOS surely) System Start Up Folder is always C:\, right ?
Oh no, it is where common users is stating (like /home/user folder in linux). Just to give you a better idea, I will show you a page which someone is same needing like me:

http://www.velocityreviews.com/forums/t ... in-xp.html
So it's unnecessary a function for this info. If your expectation is different please inform us.
Sure not necessary if would it be "C:\" return.
Esgici wrote:
Pablo César wrote:And this is it used for what ?
Esgici wrote:In windows, every short-way ( .lnk) file have two directory info: Target (Folder) and Starting Location (folder). Target is application start up and starting is working or current folder.
Sorry, I am still not understanding. Please, would post a code example which is used for ?
Say, we have an executable in c:\temp and data for use is in d:\temp; c:\temp is start up and d:\temp is current folder.
Sorry, I still do see much use in this because, I do not believe that this is like you related (very sorry). See what is in C:\hmg.3.0.40\SOURCE\h_controlmisc.prg:

Code: Select all

Function GetStartUpFolder()
Local StartUpFolder := GetProgramFileName()

Return Left ( StartUpFolder , Rat ( '\' , StartUpFolder ) - 1 )
It is where the exe is located but take off "\", just only this...
I hope that I can explain just and this will be useful for you.
[/quote]I very appreciated Mr. Esgici, sorry for my hard wood head...

But it seems was that this functions started with this proposes that you have mentioned. Petty that is not for my expectations, probably in C but still I unKnown.

Thank you Mr. Esgici once again for your explanations.

Re: HMG 3.0.40

Posted: Sat Jan 07, 2012 2:55 pm
by esgici
Hi Pablo

Before all, please don't use so much this word : "sorry"; here all we are friends, no such apologies required :)

In our country we a have a proverb : Combat of ideas emerges the light of truth !

So, I believe that every post here give a knowledge, a idea to the people. So, please don't hesitate to tell as well as your opinions, you questions, your curiosities etc.

In this "start up folder" topic, we have a confusion: This "Start Up" term have multiple meaning: :?

1- System Start Up Folder: The folder that system boot files reside. In DOS this was C:\ and I guess this continues. In fact, this info doesn't have any practical benefit to users nor programmers.

2- Application Start Up Folder: The folder that executable of THIS application reside; return value of GetStartUpFolder() function of HMG.

3- Programs Automatic Start Up Locations: Locations ( not only Folder ) that keep such programs to run automatically when system (OS) start.

If I understood right, you are expecting info about #3, by #2; right ?

If so, short answer is: No! this function doesn't return #3 info and there isn't any problem in this behavior ;)

Q: How can be such function that return #3 info ?
A: Very difficult :(

Because : Programs Automatic Start Up Locations isn't unique nor standard. Yes, Windows have such folders; in XP and some of previous versions have C:\Documents and Settings\<user>\Start Menu\Programs\Startup folders but Win7 doesn't have such folders :(

Moreover, such locations not only folders, to many registry entries too used for this purpose and information about all of that is very complicated and sadly not standard nor fixed. For more info please look at here.

The second question was : "Since returns same info like GetCurrentFolder(), what is purpose of this function ?"

Short answer was: This isn't correct; this two functions doesn't return ALWAYS same value; unless folder that keep Application executable file and folder that this application called are same.
Pablo César wrote:Please, would post a code example which is used for ?
Which is used for is a relative and personal point of view; If you don't need it, you don't use it ;)

But if you want a sample demonstrating different results by that two function, we can give such thing.

Saludos cordiales

--

Esgici

Re: HMG 3.0.40

Posted: Sun Jan 08, 2012 1:38 pm
by Pablo César
esgici wrote:Before all, please don't use so much this word : "sorry"; here all we are friends, no such apologies required :)
My intentions it was to demonstrates respect even disagree with point of view and mainly by my missunderstanding, never been by take out your point of view.
In our country we a have a proverb : Combat of ideas emerges the light of truth !
Very much appreciated. I liked it !
So, I believe that every post here give a knowledge, a idea to the people. So, please don't hesitate to tell as well as your opinions, you questions, your curiosities etc.
Thank very much to make me feel freely to discuss with you and I hope with others too. Many thanks !
In this "start up folder" topic, we have a confusion: This "Start Up" term have multiple meaning: :?
Yes, some times some terms used by his creator could give space for others meaning (this used to happen with anyone). I ask my apoligies to all my colleagues here in forum by I posted here my doubt, because I should open I new post.
If I understood right, you are expecting info about #3, by #2; right ?
It was my expectations, but I was wrong.

Thank you once again for all your attention and explanations. I liked your indications about registry options. Very appreciated.
The second question was : "Since returns same info like GetCurrentFolder(), what is purpose of this function ?"

Short answer was: This isn't correct; this two functions doesn't return ALWAYS same value; unless folder that keep Application executable file and folder that this application called are same.
You are completly right with your explanations. I have just verified with code test example.
Pablo César wrote:Please, would post a code example which is used for ?
Which is used for is a relative and personal point of view; If you don't need it, you don't use it ;)
Well, I cxould say to you that I am in pure learning HMG resources and I also very interested with all functions. This it does means that I will not use in the future. Now with all your explanations I found a way to use the function GetStartUpFolder();
But if you want a sample demonstrating different results by that two function, we can give such thing.
I already made example, please note following fact:

1. I make this example:
#include <hmg.ch>

Function Main
DEFINE WINDOW Win_1 ;
ROW 0 ;
COL 0 ;
WIDTH 400 ;
HEIGHT 400 ;
TITLE 'Hello World!' ;
ON INIT ShowMe() ;
WINDOWTYPE MAIN
END WINDOW
Win_1.Center
Win_1.Activate
Return

Function ShowMe()
MsgInfo("Using GetCurrentFolder() result: "+GetCurrentFolder()+CRLF+;
"Using GetStartUpFolder() result: "+GetStartUpFolder())
Return Nil
2. I put this executable file in folder "test" for example.
3. In prompt command, for example: I call executable file from another folder. Please see how was tested in prompt command:

cd\windows
\test\test.exe

Then in test.exe appears following results:

Using GetCurrentFolder() result: c:\windows
Using GetCurrentFolder() result: c:\test

Now I understand very well this function. I very much appreciated with explanations and now I could say that GetStartUpFolder() it will be usefull for specif situation and it right propose.