Table of Contents

File Operations

  • func CSIDLvalue(object csidl)    Translates the string name of a CSIDL_constant into its integral value or vice versa.
  • func getSpecialFolder(integer idOwner,integer nFolder)   Locates a special folder, identified by a CSIDL number.
  • func select_Directory(sequence title, object flags, atom callback, object cbData, integer nFolder)   Displays a dialog for selecting directories.


    Table of Contents

    [func]
    CSIDLvalue
    (object csidl)

    Translates the string name of a CSIDL_constant into its integral value or vice versa.

    Returns: INTEGER/SEQUENCE the value or name corresponding to csidl if successful.

    Category: File Operations

    For example CSIDLvalue("CSIDL_FONT") returns hexadecimal 14, the value of CSIDL_FONT.
    Note that CSIDLvalue("CSIDL_MYDOCUMENTS") returns the correct value of #05 and not the incorrect value of #0C, which has been seen in some documentation. Thus CSIDLvalue(CSIDLvalue(#0C)) will return #05, not #0C.
    If csidl is an atom which is not a valid CSIDL_* integer value, the routine returns an empty string. If csidl is an invalid sequence a negative integer will be returned.

    See Also: getSpecialFolder, select_Directory



    Table of Contents

    [func]
    getSpecialFolder
    (integer idOwner,integer nFolder)

    Locates a special folder, identified by a CSIDL number.

    Returns: SEQUENCE/ATOM: The path to the folder, if found, otherwise an OLE error number.

    Category: File Operations

    idOwner The win32lib id of the owner window; used only if a dialog box needs to be displayed.
    nFolder The identification number of the special folder (a constant CSIDL_*** See CSIDL_constants ). The default is 0, which is CSIDL_DESKTOP, and reverts to the default behaviour.

    		folderpath = getSpecialFolder(getMainWindow(),CSIDL_PERSONAL)
    

    See Also: CSIDLvalue, select_Directory



    Table of Contents

    [func]
    select_Directory
    (sequence title, object flags, atom callback, object cbData, integer nFolder)

    Displays a dialog for selecting directories.

    Returns: SEQUENCE: The folder name last selected or "" if the dialog is cancelled.

    Category: File Operations

    title is the Title that will appear on the dialog box, a child of the main window.
    flags are zero or more of the BIF_ values or'ed together.
    callback is the machine address of a callback used to handle events in the dialog box. callback may be omitted and will default to 0. Only advanced users will use anything other than 0 or the supplied folderDefault callback, which sets an initial folder selection from the cbData parameter.
    The prototype for the callback routine is described as BrowseCallbackProc in the Win32 API.
    cbData is an atom or an ASCII string. It may be omitted and will default to 0. If cbData is an atom it will be passed as an argument to the callback routine. If cbData is a string it may be modified by adding or removing a final '\' before a pointer to a zero-terminated copy of it is passed as an argument to the callback routine.
    If callback is zero and cbData is not zero callback will default to folderDefault. If callback and cbData are both zero, a callback function will not be used.
    nFolder is a number which identifies a special folder to use as the root folder to browse from (see CSIDL_constants and getSpecialFolder ). Only that root and the folders below that root can be selected. nFolder may be omitted and will default to 0.

    -- ask the user to choose a valid printer name. integer BIF_flags BIF_flags = BIF_VALIDATE+BIF_BROWSEFORPRINTER selectedPrinterName = select_Directory("Choose a printer",BIF_flags,0,0,CSIDL_PRINTERS)

    See Also: CSIDLvalue, getSpecialFolder