473,466 Members | 1,370 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1629

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 (CanGrow3, thanks Stephen!). In general this...
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 normal way. The problem occurs when running 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 possible. Thanks. Alex
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 to his mde and copied the modules into my db. I...
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 boxes, labels, and lines. I now need to try to...
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 Access and Windows, and have had great results with...
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 unbound image obluect in them that I set to 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 it works fine. I then added it to my application...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
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...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.