18c0d Stephen Lebans Code Puzzle
Sign Up |  Live StatsLive Stats    Articles 37,305| Comments 176,995| Members 19,397, Newest birinder| Online 438
Home Contact
 (Forgotten?): 
    Sikhism
    For best SPN experience, use Firefox Internet Browser!


                                                                   Your Banner Here!    




Stephen Lebans Code Puzzle

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 500 USD, Received: 100 USD (20%)
Please Donate...
     
Related Topics...
Thread Thread Starter Forum Replies Last Post
Punjabi Wordsearch Puzzle Generator gsingh2011 Information Technology 3 17-Jun-2012 10:53 AM
2 Questions: Code to exit via cmdExit; Code to hide/disable tool b AndyG Information Technology 5 28-Jul-2006 08:39 AM
Lebans Color Tab Program - Error doodle Information Technology 0 28-Jul-2006 08:39 AM
Lebans RichText Control Error 2771 Jesse Information Technology 2 28-Jul-2006 08:03 AM
Lebans Rich Text Control Jesse Information Technology 2 28-Jul-2006 08:02 AM


Tags
stephen, lebans, code, puzzle
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #1 (permalink)  
Old 28-Jul-2006, 08:25 AM
Peter Hibbs's Avatar Peter Hibbs
Guest
 
Posts: n/a
   
   
Stephen Lebans Code Puzzle

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
Hi All

I recently downloaded some code from Stephen Lebans Web site to convert
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/12040-stephen-lebans-code-puzzle.html
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12040
Access reports into PDF files (which is brilliant by the way). I noticed that
the following code snippet is used occasionally :-

If Len(mUncompressedSnapFile & vbNullString) > 0 Then

I don't quite understand the reason for the vbNullString in this code, could
anyone explain it. The variable 'mUncompressedSnapFile' is a normal string
variable.

--
Peter Hibbs

*







Do share your immediate thoughts or reactions on this issue? We value your views! Login Now! or Sign Up Today! to share your views with us.. Gurfateh!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 28-Jul-2006, 08:25 AM
Douglas J. Steele's Avatar Douglas J. Steele
Guest
 
Posts: n/a
   
   
Re: Stephen Lebans Code Puzzle

You sure mUncompressedSnapFile is a string, and not a variant?

When it's possible that a value could be either a zero-length string ("") or
Null, it's more efficient to use

If Len(mUncompressedSnapFile & vbNullString) > 0 Then

Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12040
than

If Not IsNull(mUncompressedSnapFile) Then
If Len(mUncompressedSnapFile) > 0 Then

or

If Not IsNull(mUncompressedSnapFile) Then
If mUncompressedSnapFile <> "" Then

In other words, what Stephen's doing there is making sure that
mUncompressedSnapFile contains a non-blank string.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Peter Hibbs" wrote in message
news:59E4A3FA-2027-485C-800E-D45D69A775B1@microsoft.com...
> Hi All
>
> I recently downloaded some code from Stephen Lebans Web site to convert
> Access reports into PDF files (which is brilliant by the way). I noticed
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12040
> that
> the following code snippet is used occasionally :-
>
> If Len(mUncompressedSnapFile & vbNullString) > 0 Then
>
> I don't quite understand the reason for the vbNullString in this code,
> could
> anyone explain it. The variable 'mUncompressedSnapFile' is a normal string
> variable.
>
> --
> Peter Hibbs



Reply With Quote
  #3 (permalink)  
Old 28-Jul-2006, 08:25 AM
Terry Kreft's Avatar Terry Kreft
Guest
 
Posts: n/a
   
   
Re: Stephen Lebans Code Puzzle

I'm guessing that originally Stephen declared it as a variant.

--

Terry Kreft


"Peter Hibbs" wrote in message
news:59E4A3FA-2027-485C-800E-D45D69A775B1@microsoft.com...
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12040
> Hi All
>
> I recently downloaded some code from Stephen Lebans Web site to convert
> Access reports into PDF files (which is brilliant by the way). I noticed

that
> the following code snippet is used occasionally :-
>
> If Len(mUncompressedSnapFile & vbNullString) > 0 Then
>
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12040
> I don't quite understand the reason for the vbNullString in this code,

could
> anyone explain it. The variable 'mUncompressedSnapFile' is a normal string
> variable.
>
> --
> Peter Hibbs



Reply With Quote
  #4 (permalink)  
Old 28-Jul-2006, 08:26 AM
Peter Hibbs's Avatar Peter Hibbs
Guest
 
Posts: n/a
   
   
Re: Stephen Lebans Code Puzzle

Hi Douglas and Terry

The variable in question is definitely declared as a String, however,
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12040
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12040
looking through the rest of the code I notice that this method is also used
against values that are passed as in-line variables in Functions which could
be Null values (maybe). Perhaps Stephen always uses the same technque for
checking a zero length string without worrying about what type of variable it
is.

Anyway, thanks for the information.

--
Peter Hibbs

Reply With Quote
  #5 (permalink)  
Old 28-Jul-2006, 08:26 AM
Stephen Lebans's Avatar Stephen Lebans
Guest
 
Posts: n/a
   
   
Re: Stephen Lebans Code Puzzle

Michael Kaplan told me this was the most efficient method to check for a
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12040
zero length string. I've been doing it ever since.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12040

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


"Peter Hibbs" wrote in message
news:8DB38BC9-7E8F-423C-9CF6-978B2CA89582@microsoft.com...
> Hi Douglas and Terry
>
> The variable in question is definitely declared as a String, however,
> looking through the rest of the code I notice that this method is also
> used
> against values that are passed as in-line variables in Functions which
> could
> be Null values (maybe). Perhaps Stephen always uses the same technque for
> checking a zero length string without worrying about what type of variable
> it
> is.
>
> Anyway, thanks for the information.
>
> --
> Peter Hibbs
>



Reply With Quote
  #6 (permalink)  
Old 28-Jul-2006, 08:26 AM
Terry Kreft's Avatar Terry Kreft
Guest
 
Posts: n/a
   
   
Re: Stephen Lebans Code Puzzle

Yes, I can see that as
"" & vbNullString = vbNullString

and there has been a long discusion elsewhere as to why testing for
Len(vbNullString) is more efficient than testing for Len("").


--

Terry Kreft


"Stephen Lebans"
wrote in message news:u5XvhfLmGHA.2056@TK2MSFTNGP03.phx.gbl...
> Michael Kaplan told me this was the most efficient method to check for a
> zero length string. I've been doing it ever since.
>
> --
>
> HTH
> Stephen Lebans
> http://www.lebans.com
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12040
> Access Code, Tips and Tricks
> Please respond only to the newsgroups so everyone can benefit.
>
>
> "Peter Hibbs" wrote in message
> news:8DB38BC9-7E8F-423C-9CF6-978B2CA89582@microsoft.com...
> > Hi Douglas and Terry
> >
> > The variable in question is definitely declared as a String, however,
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12040
> > looking through the rest of the code I notice that this method is also
> > used
> > against values that are passed as in-line variables in Functions which
> > could
> > be Null values (maybe). Perhaps Stephen always uses the same technque

for
> > checking a zero length string without worrying about what type of

variable
> > it
> > is.
> >
> > Anyway, thanks for the information.
> >
> > --
> > Peter Hibbs
> >

>
>



Reply With Quote
  #7 (permalink)  
Old 28-Jul-2006, 08:26 AM
Terry Kreft's Avatar Terry Kreft
Guest
 
Posts: n/a
   
   
Re: Stephen Lebans Code Puzzle

  Donate Today!  
I know, my statement was that "_originally_ Stephen ...".

Anyway Stephens replied elswhere.

--

Terry Kreft


"Peter Hibbs" wrote in message
news:8DB38BC9-7E8F-423C-9CF6-978B2CA89582@microsoft.com...
> Hi Douglas and Terry
>
> The variable in question is definitely declared as a String, however,
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12040
> looking through the rest of the code I notice that this method is also

used
> against values that are passed as in-line variables in Functions which

could
> be Null values (maybe). Perhaps Stephen always uses the same technque for
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12040
> checking a zero length string without worrying about what type of variable

it
> is.
>
> Anyway, thanks for the information.
>
> --
> Peter Hibbs
>



Reply With Quote
   Click Here to Donate Now!

Support Us!
Become a Promoter!
Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(View-All Members who have read this thread : 0
There are no names to display.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Tools Search
Search:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

» Active Discussions
Textbooks Terming Sikhs...
Today 18:52 PM
13 Replies, 166 Views
Do you believe in...
Today 18:52 PM
175 Replies, 3,607 Views
Map shows world's 'most...
Today 18:12 PM
14 Replies, 189 Views
Friends. A Testimony to...
Today 17:31 PM
3 Replies, 51 Views
Why are There so Many...
By Ishna
Today 17:28 PM
52 Replies, 4,852 Views
BHOOTS (Ghosts) and...
Today 13:36 PM
93 Replies, 13,742 Views
Nitnem Gutka - Gurmukhi...
By Ishna
Today 12:27 PM
15 Replies, 16,388 Views
Poetry Corner
Today 12:13 PM
83 Replies, 9,592 Views
Learn Punjabi Yourself...
Today 05:41 AM
15 Replies, 7,617 Views
Sikh Spokesman (ਪੰਜਾਬੀ...
Today 05:32 AM
167 Replies, 4,301 Views
The Great Imp Debate
Today 05:28 AM
32 Replies, 496 Views
Rozana Reports (ਪੰਜਾਬੀ...
Today 05:16 AM
299 Replies, 7,413 Views
Thought of the Moment!
Today 04:01 AM
105 Replies, 4,993 Views
Panjabi
Today 02:14 AM
9 Replies, 208 Views
Fresno Sikh Who Was...
Today 01:30 AM
0 Replies, 55 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.3
All times are GMT +6.5. The time now is 18:56 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 0.45064 seconds with 32 queries
0