By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,395 Members | 1,460 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,395 IT Pros & Developers. It's quick & easy.

error and exit statements

P: n/a
Hi everyone

It is common practice to write

Exit_Some: 'A
Exit Sub|Function

Err_Some: 'B
resume exit_some

However, in my work I call line A it and line B err, is there something
wrong with simplifying this????

it: 'A
Exit Sub|Function

err: 'B
resume exit_some


---
Please immediately let us know (by phone or return email) if (a) this email
contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.687 / Virus Database: 448 - Release Date: 16/05/2004
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Err is a reserved word, I believe, and using reserved words as labels can
mislead. As far as I know, "it" is 'safe', and you may get by with using
'err' depending on the context. Personally, I like my labels to be
reasonably descriptive -- strange as it may seem, there have been times when
I have had to come back months later to fix or modify a database application
and I appreciate that the person who created and maintained it has left
readable code.

Long, long ago, I had to revisit an application and found the person who
created it had _not_ left readable code. Unfortunately, the person who
created it was me. It was a lesson I have not forgotten.

Larry Linson
Microsoft Access MVP
"WindAndWaves" <ac****@ngaru.com> wrote in message
news:HB*******************@news.xtra.co.nz...
Hi everyone

It is common practice to write

Exit_Some: 'A
Exit Sub|Function

Err_Some: 'B
resume exit_some

However, in my work I call line A it and line B err, is there something
wrong with simplifying this????

it: 'A
Exit Sub|Function

err: 'B
resume exit_some


---
Please immediately let us know (by phone or return email) if (a) this email contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.687 / Virus Database: 448 - Release Date: 16/05/2004

Nov 12 '05 #2

P: n/a
The reason that I use the same name in all the function is:

1. easy to read
2. less to type
3. all functions have an error and exit statement.
4. to do find-replace actions across the project
5. so that I can copy one function into another (when developing) and not
having to change the error and exit statement (this reason also applies
when you change the name of the function).

I will change the err: to ers: so it will not be confused with the err
function

Thank you Larry
---
Please immediately let us know (by phone or return email) if (a) this email
contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.687 / Virus Database: 448 - Release Date: 16/05/2004
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.