Silverfrost Logo About Us | Contact Us
 

GET_FILTERED_FILE@

Platform

Win32(ClearWin+)

Purpose

To access the standard 'open' dialog box.

Syntax

 SUBROUTINE GET_FILTERED_FILE@(TITLE, FILE, PATH,
+  FILTERNAMES, FILTERSPECS, NFILTERS, MUSTEXIST )
 CHARACTER*(*) TITLE, FILE, PATH, FILTERNAMES, FILTERSPECS
 INTEGER NFILTERS, MUSTEXIST

Description

This function can be used instead of %fs and %ft in cases where the filters need to be set dynamically. The arguments are as follows.

 

 

TITLE:

The caption for the dialog box.

 

FILE:

The full path returned by the dialog box.

 

PATH:

The input path.

 

FILTERNAMES:

An array of strings for the description of file filters.

 

FILTERSPECS:

An array of strings for the corresponding filters.

 

NFILTERS

The number of file filters.

 

MUSTEXIST:

An input value that is set to 1 if the file to be selected must already exist.


 

Notes

After this routine has been called, CLEARWIN_INFO@('FILTER_ITEM_SELECTED') provides the index of the file filter that was selected by the user. This can be called, for example, to detect if the file was saved using a different file extension.

See also

GET_MULTIPLE_FILENAMES@

Example

 


     WINAPP
     INTEGER i,winio@,open_func
     EXTERNAL open_func
     i=winio@('%ca[Image info]&')
     i=winio@('%mn[&File[&Open,E&xit]]',open_func,'EXIT')
     END
c------------------------------------------------------------
     INTEGER FUNCTION open_func()
     INCLUDE <windows.ins>
     CHARACTER file*129,format*12,title*20,path*129
     INTEGER NFILTERS
     PARAMETER(NFILTERS=2) 
     CHARACTER*20 filtname(NFILTERS),filtspec(NFILTERS)
     title='Open Bitmap File'
     file=' '
     path='c:\windows'
     filtname(1)='Bitmap files'
     filtspec(1)='*.bmp'
     filtname(2)='All files'
     filtspec(2)='*.*'
     CALL get_filtered_file@(title,file,path,filtname,filtspec,
    +                         NFILTERS,1)
       . . . .
     open_func=1
     END

 

 

Copyright © 1999-2017 Silverfrost Limited