Table of Contents

SetVar2File

Set a local variable to a file name that matches the defined criteria.

Phase

This instruction is used by the TapeTrack INI Engine.

Syntax

SetVar2File(varname, filter, field, offset);

Variable Type Description Min Length Max Length Min Value Max Value
varname String The name of the local variable that is to be set. 1 16
filter String A filter that matches the file that you want to select. 1 256
Field String The field to pre-sort the selected pathnames before selection (NAME, CREATION, LASTACCESS, LASTWRITE or SIZE). 1 16
offset Integer The offset within the sorted list to select. 1 is the top, 2 is the second from the top, -1 is the bottom, -2 is 2nd from the bottom. 1 11 -214748364 2147483647

Example

Set variable MYFILE to the smallest text file in C:\stuff.

SetVar2File(MYFILE, "C:\stuff\*.txt", SIZE, -1);
WriteMsg("The smallest file is $MYFILE");