# Filidx

> [HTML Version](filidx.htm)

This optional parameter (B,4) may be specified in conjunction with file mode to create an index to the file while it is being loaded into the array. The index is dynamically allocated and kept in memory and a "handle" to the index is returned in the _filidx_ parameter. The variable _filidx_ cannot be used directly, nor should it be altered by the application. Its only use would be to pass it to the [MX\_FILEPOS](mx_filepos.md) function, along with the desired line number (of the selected item), in order to efficiently seek to the selected item. This is mainly of use with multiple-selection file mode, since the selected items are identified only by line number via the answer array.

See the sample program [XTRFIL.BP in EXLIB:\[908,21\]](https://bitbucket.org/microsabio/exlib/src/master/908021/xtrfil.bp) for an example of using _filidx_.

Note that you should only use one _filidx_ variable within a program, and you should not modify its value. If you follow this guideline, A-Shell will automatically free up the memory used by the index for each new XTREE call and when the program ends.