Microsoft KB Archive/64104

= GetDirName Works Only for Boot Drive in Macintosh QuickBASIC =

Article ID: 64104

Article Last Modified on 11/21/2006



This article was previously published under Q64104



SUMMARY
The GetDirName Toolbox Library (MBLC) routine correctly returns the folder name (commonly called the pathname) when given a volume reference number of either -1 or 0. Different numbers representing other drives either give the error message &quot;String Too Long&quot; if a device is present and being used, or a null or meaningless string if the boot drive is the only device active.

Microsoft has confirmed this to be a problem in Microsoft QuickBASIC version 1.00 for Apple Macintosh. We are researching this problem and will post new information here as it becomes available.



MORE INFORMATION
When a hard or floppy disk is used in a Macintosh computer, the Finder displays an icon in the upper-right corner to indicate its presence. A hidden integer value is also assigned to the device in a field of a record structure that defines, among other things, available storage areas to the machine. These integer values can be used in a program to refer to that device. The standard set of assigned values starts at -1 and decrements by 1 for each additional device in the order the devices are provided to the machine.

The QuickBASIC MBLC routine GetDirName will return the boot folder name only. Any other device known to the Finder (via an assigned device number) will not be correctly identified by the GetDirName function call. To find other volume names, Toolbox calls found in the &quot;Inside Macintosh&quot; series by Apple Computer (published by Addison-Wesley) must be used.

The following code sample demonstrates the GetDirName problem:

Sample Code
x$ = &quot;&quot;           REM  Initialize the string for the toolbox call GetDirName -1, x$ REM  Returns the boot volume name to x$ PRINT x$ GetDirName -2, x$ REM  This function call should return the second volume name listed in REM  the Finder window to x$. However, if there is no disk icon REM present, a null or useless string will be returned, and, if a REM  device is present, the error message &quot;String Too Long&quot; is REM  displayed. PRINT x$ INPUT &quot;Done, hit return&quot;; x$

Additional query words: MQuickB

Keywords: KB64104

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.