Using Win32 functions in Visual FoxPro Image Gallery
Shell Lightweight Utility APIs -- Path Functions
..msdn
PathBuildRoot
PathCombine
PathCompactPathEx
PathFileExists
PathFindExtension
PathFindFileName
PathFindOnPath
PathGetDriveNumber
PathGetShortPath
PathIsDirectory
PathIsNetworkPath
PathIsRelative
PathIsRoot
PathIsURL
PathRenameExtension
PathSearchAndQualify
UrlEscape
UrlGetPart
UrlHash
UrlUnescape
Code examples:
How to display Windows On-Screen Keyboard
PathCombine
..msdn    Add comment     W32 Constants      Translate this page
Concatenates two strings that represent properly formed paths into one path; also concatenates any relative path elements.
Code examples:
How to display Windows On-Screen Keyboard
Declaration:
LPTSTR PathCombine(
  __out     LPTSTR lpszDest,
  __in_opt  LPCTSTR lpszDir,
  __in      LPCTSTR lpszFile
);
FoxPro declaration:
DECLARE INTEGER PathCombine IN shlwapi;
    STRING @lpszDest,;
    STRING lpszDir,;
    STRING lpszFile
Parameters:
lpszDest [out]
Type: LPTSTR
A pointer to a buffer with the null-terminated string to hold the combined path string.

lpszDir [in, optional]
Type: LPCTSTR
A pointer to a null-terminated string of maximum length MAX_PATH that contains the directory path. This value can be NULL.

lpszFile [in]
Type: LPCTSTR
A pointer to a null-terminated string of maximum length MAX_PATH that contains the file path. This value can be NULL.
Return value:
Returns a pointer to a string with the concatenated path if successful, or NULL otherwise.
Usage:
FUNCTION VfpPathCombine(p1, p2, p3, p4, p5) As String
    LOCAL cBuffer, cPath1, cPath2, nIndex, nCount
    nCount = PCOUNT()

    DO CASE
    CASE nCount = 0
        RETURN ""
    CASE nCount = 1
        RETURN p1
    ENDCASE

    cBuffer = m.p1

    FOR nIndex=2 TO nCount
        cPath1 = STRTRAN(m.cBuffer, CHR(0), "")
        cPath2 = EVALUATE("m.p" + TRANSFORM(m.nIndex))
        cBuffer = REPLICATE(CHR(0), MAX_PATH)
        PathCombine(@cBuffer, cPath1, cPath2)
    NEXT
RETURN STRTRAN(m.cBuffer, CHR(0), "")
My comment:
The directory path should be in the form of A:,B:, ..., Z:.

The file path should be in a correct form that represents the file part of the path. The file path must not be null, and if it ends with a backslash, the backslash will be maintained.
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2012-02-19 13:40:06
Modified: 2012-02-19 13:44:40
Visited in last 7 days: 73
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.156.92.243)
12 sec.Function: 'TrackPopupMenuEx'
Function group: 'Menu'
27 sec.
Function group: 'Message and Message Queue'
42 sec.Function: 'GetCurrentProcessId'
Function group: 'Process and Thread'
54 sec.Links
1.1 min.Function: 'GetMenuContextHelpId'
Function group: 'Shell Functions'
1.27 min.All Functions
1.47 min.Solutions
1.67 min.Function: 'LockResource'
1.9 min.Function: 'StretchBlt'
Function group: 'Bitmap'
2.15 min.Articles
Google
Advertise here!