Variables

This section describes how you can work with variable in a test sequence

Internal funTEST's variables can be used in the "Parameters" column (arguments of a command). All variables are replaced before executing a row. All variables names are case-sensitive.

Usage

The variable name is always between dollar signs: $variable$ Variables can be use anywhere in the text as many times as necessary.

Example

#msg | "Hello $user-name$! Your login is $user-login$."

Display a simple message with currently logged operator name and login.

List of Standard Variables

Name
Description
Example value

$project-dir$

Directory of currently used project, without the ending backslash. All backslashes are doubled.

c:\\Users\\Public\\FPC\\ funTEST\\projects\\ECU

$project-name$

Name of currently used project.

ECU

$teststation-dir$

Directory of currently used test-station, without the ending backslash. All backslashes are doubled.

c:\\Users\\Public\\FPC\\ funTEST\\teststations

$teststation-name$

Name of currently used test-station.

MPT6

$testfile-name$

Name of currently loaded test-file.

Var1

$user-login$

Login name of currently logged-in user.

admin

$user-name$

Name of currently logged-in user.

Administrator

$lang$

Selected language, short 3-letter variant.

eng

$YYYY$

Current year, four-digit.

2015

$YY$

Current year, 00 to 99, last two-digit.

15

$MM$

Current month, 01 to 12, two-digit.

09

$M$

Current month, 1 to 12, single or two-digit.

9

$DD$

Current day, 01 to 31, two-digit.

02

$D$

Current day, 1 to 31, single or two-digit.

2

$hh$

Current hour, 00 to 23, two-digit.

08

$h$

Current hour, 0 to 23, single or two-digit.

8

$mm$

Current minute, 00 to 59, two-digit.

06

$m$

Current minute, 0 to 59, single or two-digit.

6

$ss$

Current second, 00 to 59, two-digit.

04

$s$

Current second, 0 to 59, single or two-digit.

4

$panel$

Active panel number, 0 to N. Set by #panel command.

3

User-Defined Variables

Before the row is executed, all test-file variables from the HEAD sheet are collected and added to the list of variables (replacing previous values). Test-file variable names are always converted to lower-case.

All user-defined variable must be listed in the HEAD sheet

#var (Variable operations)

Operations with defines variables in the test-file:

s - set variable(s) value(s)

st - set variables(s) value(s), forced text a - append value(s) to specified variable(s)

r - read values of specified variables

c - clear values of specified variables

Variables shown on the operator's screen are updated automatically when changed on each test-program step.

Commands Overview

Command
Parameter
Description
#var

s:<var>=<value>

set variable(s) value(s)

#var

a:<var>=<value>

append value(s) to specified variable(s)

#var

r:<var>

read values of specified variables

#var

c:<var>

clear values of specified variables

Examples

Command
Parameter

#var

s:text="abc"

Set value of "text" variable to "abc", return value will be "abc"

#cnt (Counter operations)

Set counter value, increment or decrement counter by a value or only read current counter value. Multiple counter operations can be done at once - use a semicolon ";" or doublecolon ":" to separate each counter operation. In this case, the result is the value of first operation.

Examples

Command
Parameter

#cnt

ok

This will only return value of counter "ok".

Last updated

Was this helpful?