Microsoft KB Archive/57375

= How to Create a Folder Using HFSDispatch in Mac QuickBASIC =

Article ID: 57375

Article Last Modified on 11/21/2006



This article was previously published under Q57375



SUMMARY
The program below demonstrates how to use the HFSDispatch library CALL to create a new folder from a QuickBASIC application.

This information applies to Microsoft QuickBASIC version 1.00 for the Apple Macintosh.



MORE INFORMATION
DirCreate is not a trap macro (it doesn't have an individual trap address) and therefore expands to invoke the trap macro _HFSDispatch. The File Manager determines which routine to execute from the &quot;routine selector,&quot; an integer that is placed in the D0 register.

Routine parameters that are passed to and from an application and the File Manager are contained in a parameter block, which is a data structure in the heap or stack. Parameters are passed in a block and a pointer to the block is passed instead. See Apple's &quot;Inside Macintosh&quot; (published by Addison-Wesley) for more information about the parameter block.

The code below POKEs the name of the folder into the Parameter Block and then passes the pointer of the parameter block to HFSDispatch.

Code Example
DIM iopb%(60) dirname$ = &quot;Test folder&quot; dirname$ = CHR$(LEN(dirname$)) + dirname$ POKEL VARPTR(iopb%(0)) + 18, SADD(dirname$) HFSDispatch 6,iopb%(0)   '6 is the Routine Selector value for 'creating a folder. END

Additional query words: MQuickB

Keywords: KB57375

-

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

© Microsoft Corporation. All rights reserved.