Hello,
Somebody please assist me how to check for procedure existance in harbour. I need to use it to check if a function exists prior to calling it so that it doesn't cause a gpf. When i use procExists(), hmg IDE returns the error "Linkeer .hbmk\win\mingw.....undefined refrence to 'PROCEXISTS'
Merry x-mas to you all.
ProcExists()
Moderator: Rathinagiri
- karweru
- Posts: 220
- Joined: Fri Aug 01, 2008 1:51 pm
- DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
- Contact:
ProcExists()
Kind regards,
Gilbert.
Gilbert.
Re: ProcExists()
Hello Gilbert,karweru wrote:Hello,
Somebody please assist me how to check for procedure existance in harbour. I need to use it to check if a function exists prior to calling it so that it doesn't cause a gpf. When i use procExists(), hmg IDE returns the error "Linkeer .hbmk\win\mingw.....undefined refrence to 'PROCEXISTS'
Merry x-mas to you all.
Try the following function:
Code: Select all
Function procExists( cFunc )
Return !( Type ( cFunc + '()' ) $ 'U,UE' )
...
mVar := "myFunc"
If !procExists( mVar )
MsgAlert("Function "+ mVar + "() is not defined.")
EndIf
...
Hope that helps.
Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
- dhaine_adp
- Posts: 457
- Joined: Wed Aug 06, 2008 12:22 pm
- Location: Manila, Philippines
Re: ProcExists()
Hi Grigory,Function procExists( cFunc )
Return !( Type ( cFunc + '()' ) $ 'U,UE' )
Well, well, simple yet powerful code, Grigory. I admire that, the signature of a master.
Regards,
Danny
Regards,
Danny
Manila, Philippines
Danny
Manila, Philippines
- karweru
- Posts: 220
- Joined: Fri Aug 01, 2008 1:51 pm
- DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
- Contact:
Re: ProcExists()
Thank you so so much Grigory! It works like a charm! Thank you indeed for coming to my aide. Have a very merry christmas!
Kind regards,
Gilbert.
Gilbert.