Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Retrieving current line of code in a module
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00360934
Message ID:
00360944
Views:
9
Jim,
I am trying to create a SQLExec error handler. If there is a problem with the SQLExec command it returns a -1; not very informative in and of itself. However, if you query the AError() function just after it, you can get the details of why it failed.

I set a property to the return value of my SQLExec statement. In the Assign method, I check to see if its < 0, and if so call the Aerror() function. I then pass this information to my generic error handler and it knows what to do with it (currently it just reports it, but that may change *s*).

I would like to have this in one place instead of checking after each SQLExec statement and then querying lineno() at that point.

Suggestions?

>>Hi All,
>>Is there a way to programmtically retrieve the current line of code, given a program? For example, if I have a procedure or class method that is called several times from a module, how can I determine what line of code launched it?
>>
>>I can't pass the value becuause the procedure is an ASSIGN method and AFAIK, it only accepts one parameter. I can get the program that called it by using Program(program(-1)-1) but I want the line number or the actual line of code that initiated the call.
>>
>>Any ideas?
>
>Larry,
>
>Interesting problem. Could you explain a little more about why you need to know this? It sounds like it may be an external coupling problem and there may be another approach to accomplish the ultimate goal.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform