duplicate function name in different prgs

Discuss anything else that does not suite other forums.

Moderator: Rathinagiri

Post Reply
User avatar
Anand
Posts: 595
Joined: Tue May 24, 2016 4:36 pm
DBs Used: DBF

duplicate function name in different prgs

Post by Anand »

I have a project with two reports. I first made one report rep_firstcn.prg which has functions like opendbf, closedbf, reportprint etc. All these functions are not "static" i.e. they are accessible from other prgs. Now I create another report rep_lastcn.prg which too have the above functions and not in "static" mode.

Now if I compile the same two prgs in Clipper I get "Function already exist in XX" error, but HbMG is not giving any error. It is executing the wrong functions. I should make the functions "Static" but my query is,

How can I make HbMG to give the "Function already exist in XX" error message, so that I get to know which prgs to correct.

I could not find the solution in searching this forum and also googling. Please guide.

Regards,

Anand
Regards,

Anand

Image
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: duplicate function name in different prgs

Post by andyglezl »

Hola

Porque 2 .prg con las mismas funciones ?
Puedes hacer solo uno y enviar como parametros lo que sea diferente.
( dbf, Titulo, etc. )
------------------------------------------------------------------------------------
Hello
Why 2 .prg with the same functions?
You can do just a prg and send as parameters that is different.
(Dbf, Title, etc.)
Andrés González López
Desde Guadalajara, Jalisco. México.
Carlos Britos
Posts: 245
Joined: Sat Aug 02, 2008 5:03 pm

Re: duplicate function name in different prgs

Post by Carlos Britos »

Hi
Anand wrote:
How can I make HbMG to give the "Function already exist in XX" error message, so that I get to know which prgs to correct.
Anand
MinGW show you the duplicate function while compiling, in fact show you an error at compilation time. Except if you set the mingw param to avoid it. I don't remember a this moment the name of the parameter
Regards/Saludos, Carlos (bcd12a)
User avatar
Anand
Posts: 595
Joined: Tue May 24, 2016 4:36 pm
DBs Used: DBF

Re: duplicate function name in different prgs

Post by Anand »

Hi andyglezl and Carlos Britos,

Thanks for your reply.

I have attached a sample project files print_report.zip. It has two report prgs namely test2.prg and test3.prg. Both use same named functions to open and close dbf "openfile" and "closefile".

When I run build.bat, it does not give error "duplicate "openfile" function" and the exe calls the "openfile" from test2.prg from test3.prg

Please compile and run the exe to understand the problem. I have tried to make it as simple as possible. There may be some switches for it which I do not know. Please guide.

Please note I know that by making "Static" this problem will be solved, but I want the compiler to warn me as when I work with large project files I copy prgs from other projects which may have similar function names.

Regards,

Anand
Attachments
print_report.zip
(1.02 KiB) Downloaded 230 times
Regards,

Anand

Image
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: duplicate function name in different prgs

Post by Rathinagiri »

When I had imported your project to HMG 3.4.3 IDE and compiled, I got the error of duplicate function names. Don't you get that?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Anand
Posts: 595
Joined: Tue May 24, 2016 4:36 pm
DBs Used: DBF

Re: duplicate function name in different prgs

Post by Anand »

Hi Rathinagiri Sir,

No, I did not get error mesg.

I ran the build.bat file and no error. Also the my IDE did not give any error, see screen shot attached.

But I noted that my ide is showing version 1.3.0. Also MiniGUI version is "Harbour MiniGUI Extended Edition 16.04"
I think I have old version of Harbour and MiniGUI which is causing the problem. Please guide me which link should I use to download the correct version.

Regards,

Anand
Attachments
Clipboard01.jpg
Clipboard01.jpg (87.06 KiB) Viewed 5362 times
Regards,

Anand

Image
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: duplicate function name in different prgs

Post by Rathinagiri »

I am using the HMG official IDE. I think you are saying about HMG Extended.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Anand
Posts: 595
Joined: Tue May 24, 2016 4:36 pm
DBs Used: DBF

Re: duplicate function name in different prgs

Post by Anand »

Thanks a lot Sir :D

Yes I was using MiniGUI Extended assuming it was the latest version of HMG.
I downloaded hmg.3.4.3 from link in home page of this forum and installed. The ide gave error and also after I made changes to build.bat file, pointing to it, it gave error. Now I can relax. Thanks again.

I will use this version now onward.

Just a query what is MiniGUI Extended then ? It can be found Googling for harbour and I thought that was the version to use.

Regards,

Anand
Regards,

Anand

Image
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: duplicate function name in different prgs

Post by Rathinagiri »

MiniGUI Extended is also a Parallel version of HMG developed and maintained by another group of people having our member Grigory Filatov as the lead developer. It is also another variety of HMG. Regarding the IDE of MiniGUI Extended, you can ask your doubts in their yahoo group.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
Post Reply