I'm trying to figure out if there is a way to generate standard error handlers
that "know" if the calling code has an error handler in effect (On Error Goto
<label> or On Error Resume Next) before deciding how to respond. Does anyone
know if this is possible.
Nov 13 '05
16 2653
"Steve Jorgensen" <no****@nospam. nospam> wrote... The order of calling and returning will be correct, but since the timer
event is called by Access, not by the previously called code, if it raises an
error, the previously called code's hanlder will not be invoked. Access will
close. Am I missing something?
Since you will have an error handler in your Timer event proc, it will not
bubnble any further up.
--
MichKa [MS]
NLS Collation/Locale/Keyboard Development
Globalization Infrastructure and Font Technologies
This posting is provided "AS IS" with
no warranties, and confers no rights.
H vae you looked at the call stack in such instances while debugging? It
handles the issue quite nicely; so can you.
--
MichKa [MS]
NLS Collation/Locale/Keyboard Development
Globalization Infrastructure and Font Technologies
This posting is provided "AS IS" with
no warranties, and confers no rights.
"Steve Jorgensen" <no****@nospam. nospam> wrote in message
news:jv******** *************** *********@4ax.c om... On Sun, 6 Jun 2004 16:19:55 -0700, "Michael \(michka\) Kaplan [MS]" <mi*****@online .microsoft.com> wrote:
...????
If on entry your Timer proc does the appropriate push/pop then you will
knowwhere you are. Access/VBA are not multithreaded so you can just go with that. I just realized what I was thinking of that you might not have been.
Access VBA is not technically multi-threaded, but there are times, such as when a dialog box is open when timer events (and other events) can fire and be processed when they were not called by the running code that's waiting for
the dialog. The calling order does not mirror the internal the call stack in
such cases.
On Sun, 6 Jun 2004 20:16:43 -0700, "Michael \(michka\) Kaplan [MS]"
<mi*****@online .microsoft.com> wrote: "Steve Jorgensen" <no****@nospam. nospam> wrote...
The order of calling and returning will be correct, but since the timer event is called by Access, not by the previously called code, if it raises an error, the previously called code's hanlder will not be invoked. Access will close. Am I missing something?
Since you will have an error handler in your Timer event proc, it will not bubnble any further up.
Ah, but there's the rub. The whole idea I was trying to come up with is a
generic error handler that can tell if it was called from another procedure
that has an error handler or not.
I never worried about this when it was just me maintaining my code, but I'm
working with someone else on a project who doesn't feel comfortable that he
understands my logic on which procedures need what kind of error handling.
"Steve Jorgensen" <no****@nospam. nospam> wrote... Ah, but there's the rub. The whole idea I was trying to come up with is a generic error handler that can tell if it was called from another
procedure that has an error handler or not.
That is the whole idea? Darn, because thats a lousy idea even when its only
part of the idea.
I never worried about this when it was just me maintaining my code, but
I'm working with someone else on a project who doesn't feel comfortable that
he understands my logic on which procedures need what kind of error handling.
So always have error handlers in every event proc, and then you are covered.
--
MichKa [MS]
NLS Collation/Locale/Keyboard Development
Globalization Infrastructure and Font Technologies
This posting is provided "AS IS" with
no warranties, and confers no rights.
>> I never worried about this when it was just me maintaining my code, but I'm working with someone else on a project who doesn't feel comfortable that he understands my logic on which procedures need what kind of error handling.
So always have error handlers in every event proc, and then you are covered.
Now, the thread has gone full circle. Putting error handling in every
procedure is fine, but what goes into each error handler still depends what
the context of the procedure will be. If the calling procedure should stop if
the called code fails, the called code should re-raise the error - or just not
handle it if no clean-up is neeeded and if we weren't talking about putting
error handlers everywhere (though adding the proc name to Source is nice).
If a procedure is always invoked by a user action, it should report the error
to the user and do a normal procedure exit. That's how I always write my
error handlers, and that always works as advertised, but since the new code
owner doesn't get this, I was trying to see if I could get the code to be
intelligent enough to do it automatically, and just eliminate this as a
maintenance issue for the programmer.
Not really -- in the case of event code you can just about always assume
that it is Access that is "on the stack" triggering the event, and just trap
the errors yourself. All you need to do is use your brain about the event
itself to decide what to do..... and add comments for the maintenance
programmer.
Thinking about them is great, but all the time you are spending trying to
make the code automatic would probably be better served enhancing comments
enough so that when they are debugging they are not lost.
--
MichKa [MS]
NLS Collation/Locale/Keyboard Development
Globalization Infrastructure and Font Technologies
This posting is provided "AS IS" with
no warranties, and confers no rights.
"Steve Jorgensen" <no****@nospam. nospam> wrote in message
news:07******** *************** *********@4ax.c om... I never worried about this when it was just me maintaining my code, but
I'm working with someone else on a project who doesn't feel comfortable
that he understands my logic on which procedures need what kind of error
handling.So always have error handlers in every event proc, and then you are
covered. Now, the thread has gone full circle. Putting error handling in every procedure is fine, but what goes into each error handler still depends
what the context of the procedure will be. If the calling procedure should
stop if the called code fails, the called code should re-raise the error - or just
not handle it if no clean-up is neeeded and if we weren't talking about
putting error handlers everywhere (though adding the proc name to Source is nice).
If a procedure is always invoked by a user action, it should report the
error to the user and do a normal procedure exit. That's how I always write my error handlers, and that always works as advertised, but since the new
code owner doesn't get this, I was trying to see if I could get the code to be intelligent enough to do it automatically, and just eliminate this as a maintenance issue for the programmer.
On Mon, 7 Jun 2004 03:32:13 -0700, "Michael \(michka\) Kaplan [MS]"
<mi*****@online .microsoft.com> wrote: Not really -- in the case of event code you can just about always assume that it is Access that is "on the stack" triggering the event, and just trap the errors yourself. All you need to do is use your brain about the event itself to decide what to do..... and add comments for the maintenance programmer.
Uh - yeah. That's pretty much what I said to the other programmer.
Thinking about them is great, but all the time you are spending trying to make the code automatic would probably be better served enhancing comments enough so that when they are debugging they are not lost.
Well, it's always worth taking some time to see if concerns can be moved
completely out of the programmer's way because it saves time and reduces bugs
later - on future projects as well. If there's no way to do it, there's no
way to do it, but I like to go ahead and try to explore the options. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: John Roth |
last post by:
PEP 263 is marked finished in the PEP index, however
I haven't seen the specified Phase 2 in the list of changes
for 2.4 which is when I expected it.
Did phase 2 get cancelled, or is it just not in the
changes document?
John Roth
|
by: tabonni |
last post by:
I want to check each button groups and save the checked value into a 2
dimensional array. But, it doesn't work. Could anyone tell me what's
wrong with my code. My code is as follow:
<html>
<body>
<script language="javascript">
<!--
var temp = new Array(2)
var status = new Array();
|
by: collincm |
last post by:
Hi,
I am trying to optimize a table for inserts. Half of the timeron cost is in
the FK lookup!
These tables for example
CREATE TABLE FOO2(
FOO2_ID INTEGER NOT NULL CONSTRAINT FOO2_PK PRIMARY KEY,
DATA VARCHAR(200) NOT NULL,
LASTTIME TIMESTAMP NOT NULL);
|
by: V_S_H_Satish |
last post by:
Hai Friends
Quite a long time back i ask these questions but everybody send me some
snapshot and functions names but i need select statements for the
following stuff pls help me in this
1. instance name instance status from which table
2. db status and db name fro which table
|
by: John Salerno |
last post by:
My code is below. The main focus would be on the OnStart method. I want
to make sure that a positive integer is entered in the input box. At
first I tried an if/else clause, then switched to try/except. Neither is
perfect yet, but I was wondering which I should try for in the first
place. I figure I need to check for an emptry string, non-numeric
strings (maybe these are the same check), 0 and negative numbers (which
might also fall into...
| |
by: Chandra |
last post by:
How do I programmatically (javascript) check if link is valid in html?
|
by: polycom |
last post by:
Hi,
I am coding a mysql health check script. The logic is to execute the commands (only once)show status,show slave status,show variables and fetch the variable name and value in a hash refer or any other fetch machanism and dynamically use the values to do calculation like the following
threhold values($uptime > 10800) && (Handler_read_rnd_next > 4000) && ((100-(((Handler_read_rnd_next + Handler_read_rnd) / (##Handler_read_rnd_next +...
|
by: Edwin.Madari |
last post by:
updated creature running in its own thread will get you started. try it foryourself, change sleep times per your need.
import os, sys, threading, time
class Creature:
def __init__(self, status):
self.status = status
self.state = 'run'
def start(self):
self.athread = threading.Thread(target=self.print_status)
|
by: alex21 |
last post by:
I'm trying to detect the http status number such as (401 Unauthorized) from a 'WebException' when a WebClient in my code fails.
Public Function DataSources_ValidURL() As Boolean
Dim TestClient As New WebClient()
TestClient.BaseAddress = DataSources_FilePath
Try
TestClient.DownloadString(DataSources_FilePath)
Catch ex As WebException
If ex.Status = 401 Then
...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |