[AccessD] CurrentProject.Path syntax?

Max Wanadoo max.wanadoo at gmail.com
Thu Mar 18 09:56:13 CDT 2010


Sigh...

   str = str & IIf(Right(str, 1) = "\", "", "\")

Easy peasy - one liner.

Max
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert
Sent: Thursday, March 18, 2010 2:06 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] CurrentProject.Path syntax?

CRAB eh?

I maintain that this code 

Public Function QualifyPath(sPath As String) As String
    If sPath & "" > "" Then
        If right$(sPath, 1) = "\" Then
            QualifyPath = sPath
        Else
            QualifyPath = sPath & "\"
        End If
    End If
End Function 

Is thoroughly self documenting and orders of magnitude clearer than

    str = "\\svr\c\"
    strL = Left(str, 2)
    strR = Replace(Mid(str, 3) & "\", "\\", "\")
    str = strL & strR

In fact I'd go as far as to suggest that those few lines of VB code are
almost as cryptic as some c/c++ code I have reviewed in the past. The C
family has a well deserved reputation of being a write-only language. Well
in the hands of some programmers. :-)


Lambert

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo
Sent: Thursday, March 18, 2010 9:50 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] CurrentProject.Path syntax?

Are you saying:-

A. mine doesn't
B. mine is 20th century too.

Co'mon now. Don't beat about the bush...out with it...

Answers:
A. Mine does UNCs better than yours.  Stamps foot and sticks tongue out.  So
there!
C. Mine adheres to the CRAB principle invented by yours truly (Clear,
Relevant,  Accurate and Brief).

There we go...over and out....

Max
 
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list