[AccessD] CurrentProject.Path syntax?

Heenan, Lambert Lambert.Heenan at chartisinsurance.com
Thu Mar 18 09:05:49 CDT 2010


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
 



More information about the AccessD mailing list