# foldersearch

Search a folder. (version 4.69 or later)

    foldersearch <foldername>

## Remarks

Searches for the folder specified by <foldername>.
If it is found, the system variable "result" is set to 1. Otherwise, "result" is set to zero.

## Note

The foldersearch command returns 1 when the <foldername> is a folder, and returns 0 when the <foldername> is a file. For this reason, this command can not be used as checking the existing folder.

## Example

    foldersearch 'data'
    if result=0 messagebox 'Folder not found.' 'error'

    name = 'data'
    filesearch name
    if result=1 then
        foldersearch name
        if result=1 then
            sprintf2 msg '%s is a folder.' name
            messagebox msg ''
        else
            sprintf2 msg '%s is a file.' name
            messagebox msg ''
        endif
    else
        sprintf2 msg '%s is not found.' name
        messagebox msg ''
    endif

## See also

- filesearch