DOCUMENT:Q110128 05-FEB-2000 [foxpro] TITLE :PRB: "Unrecognized Phrase/Keyword..." with Macro Substitution PRODUCT :Microsoft FoxPro PROD/VER:MACINTOSH:2.5b,3.0b OPER/SYS: KEYWORDS:kberrmsg ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft FoxPro for Macintosh, version 2.5b - Microsoft Visual FoxPro for Macintosh, version 3.0b ------------------------------------------------------------------------------- SYMPTOMS ======== When you use macro substitution with a filename that contains spaces, the error message "Unrecognized phrase/keyword in command" occurs. CAUSE ===== The Macintosh file system allows filenames to have spaces. This feature can cause errors in programs that use macro substitution and don't allow for spaces. Macro substitution in FoxPro is direct text substitution. Consider the following code: x='MAC HD:FOXPRO:DATABASE' USE &x This code is exactly equivalent to the following USE command: USE MAC HD:FOXPRO:DATABASE However, this USE command isn't valid because FoxPro thinks the filename is MAC and doesn't understand what HD:FOXPRO:DATABASE is supposed to be. RESOLUTION ========== To work around this problem, do one of the following: - Pad the composed text string with another set of quotation marks: x="'MAC HD:FOXPRO:DATABASE'" Note the double quotation marks and single quotation marks. You can also use "" or ''. -or- - Use a named expression: x='MAC HD:FOXPRO:DATABASE' USE (x) Additional query words: VFoxMac FoxMac file name marco errmsg err msg ====================================================================== Keywords : kberrmsg Technology : kbHWMAC kbOSMAC kbVFPsearch kbAudDeveloper kbFoxproSearch kbFoxPro250bMac kbVFP300bMac Version : MACINTOSH:2.5b,3.0b ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 2000.