Polybench® Reference
Collection of variables that are globally available in a Polybench project.

Global Variables

Overview

In all objects in a Polybench project a number of standard variables are available. Those are the global variables. You can add your own global variables using the SET_PARAMETER action (link), see below.
This section further lists all pre-defined global variables.

Items


$startupfolder$
Use '$startupfolder$' to get the folder where Polybench is installed (probably a sub-folder of C:\Program Files\).


$doc$
Use '$doc$' to get the standard Documents folder (My Documents in Windows XP) of the current Windows account. On different computers and user accounts this path may be different.
Example: $doc$\Polybench\ is the folder 'Polybench' in your Documents folder.


$appdata$
Use '$appdata$' to get the standard Application Data folder path of the roaming user of the current Windows account. In this folder software programs typically store their settings.


$desktop$
Use '$desktop$' to get the Desktop folder path on the current Windows account.


$applicationfolder$
Use $applicationfolder$ to get the path of the folder in which this project is located.
You could use this, for example, to load a data file that is located in the same folder as this project. You would then use a path like: $applicationfolder$\Sample.DataFile.csv.


$applicationfilename$
Use $applicationfilename$ to get the file name (without folder) of this project.


$year$
Use $year$ to get the current year, for example '1975'.


$month$
Use $month$ to get the number of the current month in two digits, for example '07'.


$day$
Use $day$ to get the number of the current day of the month in two digits, for example '03'.


$hour$
Use $hour$ to get the number of the current hour in two digits, for example '09'.


$minute$
Use $minute$ to get the number of the current minute in two digits, for example '45'.


$second$
Use $second$ to get the number of the current second in two digits, for example '05'.


$dayname$
Use $dayname$ to get the name of the current week day in the language of the culture that has been set for the operating system.
For example on a US computer: 'Monday'; on a German computer: 'Montag'.


$polybenchversion$
Use $polybenchversion$ to get a version number of the Polybench engine that is currently used.
The version number consists of four numbers separated by dots. This number could be handy for support calls.


$ext$
The variable $ext$ does not have a value by default. It is only used in a specific context, for example for setting file storage settings. This variable however is reserved and cannot be used for other purposes.


$alias$
The variable $alias$ does not have a value by default. It is only used in a specific context, for example for setting file storage settings. This variable however is reserved and cannot be used for other purposes.


$applicationname$
Use $applicationname$ to display the name of the project. See the Caption property of the project (link).


$applicationversion$
Use $applicationversion$ to display the version of the project. See the Version property of the project (link).


$applicationdescription$
Use $applicationdescription$ to display the description of the project. See the Description property of the project (link).


$applicationauthor$
Use $applicationauthor$ to display the author of the project. See the Author property of the project (link).


$applicationcopyright$
Use $applicationcopyright$ to display the copyright information of the project. See the Copyright property of the project (link).


$applicationhelpurl$
Use $applicationhelpurl$ to display or use the Help URL for this project, which is a URL to a website containing information about the project (or the application that is the result of this project). See the HelpURL property of the project (link).


$computername$
Use $computername$ to get the name of your computer. This is the NetBIOS name.


$operatingsystemversion$
Use $operatingsystemversion$ to get the version of the OS of the computer Polybench runs on.


$computerusername$
Use $computerusername$ to get the user name of the user that is currently logged in into Windows.


$screenheight$
Use $screenheight$ to get the height of the current screen in pixels. You may also want to use $screenwidth$.


$screenwidth$
Use $screenwidth$ to get the width of the current screen in pixels. You may also want to use $screenheight$.


??????
If in a display that should have shown a value in place of an address, the text '??????' is shown, then the address is not correct. Please check if the address exists.


xxxxxx
If in a display that should have shown a value in place of an address, the text 'xxxxxx' is shown, then the address is correct, but the value cannot shown in the text. Please check if the address refers to something that can be displayed as text.


$NL$
Use $NL$ to get the a carriage return/line feed (New Line) character. You may use this for building strings out of variables, if you need your text output to be on multiple lines.

Details

Example of use: get a Variable Viewer (link) from the toolbox and open its properties.
In the property Addresses and Text you could fill in any of the listed global variables, for example:

The time is $hour$:$minute$:$second$

Add a global variable from within the project

A new global variable is created as soon as you try to write a value to a new variable name. Writing values to a variable is done using the SET_PARAMETER action.
For example, the following action will create a new global variable $var$, if that variable did not already exist:
action: SET_PARAMETER
address: $var$
value: Some text or a numerical value

After executing that action (for example using an Action Button), $var$ contains "Some text or a numerical value".

Add a global variable at start-up

When starting Polybench.exe (link) or PolybenchRun.exe (link), you may specift arguments. A couple of standard arguments have been defined, but any other argument names are translated to global variables.

For example, if you start Polybench Designer like this:

Polybench.exe /program:"MyApp.xmc" /MyVariable:12.3

then if MyApp.xmc is loaded, it will contain a global variable called $MyVariable$ and its value is 12.3.

Polybench Manager allows to specify custom arguments for apps that are started from the application quick-start panel in the Application Start dialog (link).