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?
ISIGestAsked:
Who is Participating?
 
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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.