TapeTrack Documentation

Because there is more to tape management than you ever realized

User Tools

Site Tools


engine:import:setvar2file

This is an old revision of the document!


Table of Contents

setvar2file

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);

string varname;
string filter;
string field;
int offset;

varname The name of the local variable that is to be set.
filter A filter that matches the file that you want to select.
Field The field to pre-sort the selected pathnames before selection (NAME, CREATION, LASTACCESS, LASTWRITE or SIZE).
offset 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.

Example

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

SetVar2File(MYFILE, “C:\stuff\*.txt”, SIZE, -1);
WriteMsg(“The smallest file is $MYFILE”);
engine/import/setvar2file.1534282780.txt.gz · Last modified: 2025/01/21 22:07 (external edit)