• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1013
  • Last Modified:

override standard SQLEXEC function vfp

Hi, I've a problem with the standard SQLEXEC function of VFP:
I have some procedure that call the standard SQLEXEC function but i want that this procedure call another personal function named "SQLEXEC" that execute some code before call the standard SQLEXEC function....can I do that?
0
ISIGest
Asked:
ISIGest
1 Solution
 
pcelbaCommented:
It is possible to name your own procedure SQLEXEC but to call it is a little bit problematic. You have to make changes to the compiled module otherwise the built-in function takes precedence...

So, the easiest way is to create your own procedure with different name, e.g. MySQLEXEC, change all SQLEXEC calls to MySQLEXEC calls and then you may do whatever you need in MySQLEXEC.
0
 
tusharkanvindeCommented:
You have Code Reference in Tools menu which will help you find all the instances of SQLEXEC to change if required.

You can also put

#DEFINE SQLEXEC MySQLEXEC

in a .h header file and include that in your form class. Then all calls to SQLEXEC in all your forms will go to MySQLEXEC.
0
 
pcelbaCommented:
Such define directive is a little bit confusing and I would rather avoid it.

Or, maybe... it allows to deliver source code which does not work as it should...

#DEFINE SIN COS
#DEFINE RAND SIN
#DEFINE IF DO WHILE
#DEFINE ENDIF ENDDO
#DEFINE ELSE LOOP

<s>
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
tusharkanvindeCommented:
LOL

Guess the code reference would be a better option.
0
 
Olaf DoschkeSoftware DeveloperCommented:
Like the others already said, you're a little late in detecting this namespace overloading of a foxpro command. The help has a chapter with all keywords you should avoid to use as names of userdefined functions.

Code references will give you the best options to replace all SQLExec with some other name.

Bye, Olaf.
0
 
ISIGestAuthor Commented:
I've solved renaming all SQLEXEC call function in all procedure...
0
 
pcelbaCommented:
BTW, did you use Code reference or simple Find and Replace All?
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now