472,333 Members | 1,137 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,333 software developers and data experts.

I use Stephen Lebans modReportToPDF...

MLH
I use Stephen Lebans modReportToPDF. In it is a function
declared as Boolean. Inside the FN, there's a line assigning
the FN name a value that's not True and not False. I'm thinking
that's an oversight so I changed it from "" to False. Just wanna
make sure there's not some support of the use of the ZLS value.

Public Function ConvertReportToPDF( ... ) As Boolean
....

If Len(RptName & vbNullString) = 0 Then
' No valid parameters - FAIL AND EXIT!!
ConvertReportToPDF = ""
Exit Function
End If
I think the assignment line should be...
ConvertReportToPDF = False
and that setting it to a zero-length string was
an oversight.

Would there be any reason that assigning the
null string value would be logical?
Jun 27 '08 #1
3 1545

the If Len(RptName & vbNullString) = 0 Then
' No valid parameters - FAIL AND EXIT!!
ConvertReportToPDF = ""
Exit Function
End If
Would there be any reason that assigning the
null string value would be logical?
The comments *right* before that line say "FAIL" and exit.

They don't just say *exit*.

That assignment will fail, and trigger the error handling code. If you look
at the error handling code, there is a Significant amount of cleanup and
release of variables and other things that occur.

I suppose one could have actually put in a goto to the jumping of the error
handling code, but the above code means that you fail regardless of the name
of the subroutine name given to the error handling code you've setup.

It is also entirely possible that this is a typo on Stephens part, but I'm
not sure, since the error handling code does seem to do a fair bit of
cleanup and then exits. just reading the code, my bets are this is an
intentional forced error. (I should also that the compiler does not catch
this error, as you can legally assign a strained to a Boolean variable, as
long as that string is yes, no, true, false, 0,-1 etc.).

Hopefully Stephen will chime in, but my spider sense tells me that is an
intentional error trigger.

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
Jun 27 '08 #2
Unfortunately, I cannot remember that far back in time. It certainly looks
like a typo to me. The function signature return value is Boolean so it
should return a Boolean value, period!

Poor engineering Doug. Please don't tell my brother!<grin>

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Albert D. Kallal" <Pl*******************@msn.comwrote in message
news:GQ5Sj.103945$Cj7.3949@pd7urf2no...
>
the If Len(RptName & vbNullString) = 0 Then
> ' No valid parameters - FAIL AND EXIT!!
ConvertReportToPDF = ""
Exit Function
End If
>Would there be any reason that assigning the
null string value would be logical?

The comments *right* before that line say "FAIL" and exit.

They don't just say *exit*.

That assignment will fail, and trigger the error handling code. If you
look at the error handling code, there is a Significant amount of cleanup
and release of variables and other things that occur.

I suppose one could have actually put in a goto to the jumping of the
error handling code, but the above code means that you fail regardless of
the name of the subroutine name given to the error handling code you've
setup.

It is also entirely possible that this is a typo on Stephens part, but I'm
not sure, since the error handling code does seem to do a fair bit of
cleanup and then exits. just reading the code, my bets are this is an
intentional forced error. (I should also that the compiler does not catch
this error, as you can legally assign a strained to a Boolean variable, as
long as that string is yes, no, true, false, 0,-1 etc.).

Hopefully Stephen will chime in, but my spider sense tells me that is an
intentional error trigger.

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com

Jun 27 '08 #3
MLH
Albert, I think you are correct. Stephen does have
ConvertReportToPDF = False embedded in his
error handler under ERR_CREATSNAP:
That ensures a correct Boolean setting when the
procedure ends. Likely intentional. Nice.

Thx to both of you for the input.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxx
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Wally | last post by:
Hi All, I'm using Stephan Lebans' nifty code for automatically resizing text fields to the size required to show (almost) all text in that field...
11
by: Patrick | last post by:
I am using Stephans code to change the background color of the Access container in Access 97, the code works fine when running in Access in the...
1
by: Alex | last post by:
The JustiDirect text justification on Stephen LeBans site works well but I cannot get it to work on a sub report. Could anyone tell me if this is...
3
by: Alex Wisnoski | last post by:
I am trying to adapt Lebans' ReportUtilities to export reports (to preserve formatting) from an Access 97 application. I have made the reference...
4
by: Karl Roes | last post by:
Hi Stephen, Very Cool. I can only get it working on the first row of a continuous form. Is this correct? Regards Karl
3
by: Phil Stanton | last post by:
I am trying to produce a program that will output any Access report to an editable Word document. So far it is working well but slowly with text...
3
by: Rémi | last post by:
Hello all! I've been using Stephen Lebans' MouseWheel stuff for a number of years now, without problems. I've used on different combinations of...
8
by: grant | last post by:
Hi I've copied Stephens code into my db, and can get it to work, but only on "plain Jane" reports with no images. Most of my reports has an...
30
by: CD Tom | last post by:
I found Stephen Lebans modReportToPDF and have been trying to get it to work in my application. I've downloaded his database and when I run his test...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.