It is often needed to enter a path to the file or folder in the PROMOTIC system. Two types of path format can be entered. It is recommended to use the PROMOTIC path format.
Microsoft path format:
The path format is e.g.
c:\data\BoilerPlant\file.dbf, but there are some disadvantages:
- If you want to later modify the disk or folder with application data, then the modification may be complicated, because it is used on multiple places in the application.
- Based on the Microsoft standard, the items in path are separated by
backslash (
\). But this is disadvatageous if the path is to be defined as text in quotation marks. For example the
JavaScript language has a special purpose for the backslash. Therefore two backslash characters must be used instead of one, e.g.
"c:\\data\\BoilerPlant\\file.dbf".
PROMOTIC path format:
The path format is e.g.
#data:BoilerPlant/file.dbf, i.e.:
- The path does not begin with the drive letter but with PROMOTIC system folder (e.g.
#data:).
This folder is defined on one place only (see the "
Paths to system folders" configurator), and therefore can be changed easily and the path modification will project itsef into all paths used in the application.
- The path items are separated by slash (/) so there is no problem using these in the string in quotation marks.
The following PROMOTIC system folders are defined:
#gpm: Path to the main folder of the PROMOTIC system (e.g.
C:\Promotic\).
#pm: Path to the folder of corresponding PROMOTIC system version (e.g.
C:\Promotic\PmVXXYY\).
#pmres: Path to the PROMOTIC system resources folder (e.g.
C:\Promotic\PmVXXYY\Resource\).
The path must be specified also with source type:
#apps: Path to the PROMOTIC applications folder (e.g.
C:\Promotic\Apps\). Path to this folder can be set in the
PmCfg.ini file in the main folder of the PROMOTIC system.
#cfg: Path to the application configuration files folder (the folder is defined in the "
PmaRoot > Application > #cfg: - to configuration files" configurator). It is recommended to store files with a configuration data to this folder (the information that is not changed very often - contrary to
#data:).
#win: Path to the
Windows folder (e.g.
C:/Windows/).
#winsys: Path to the
Windows system folder (e.g.
C:/Windows/System32/).
#winuser: Path to the home folder of the current
Windows user (e.g.
C:/Users/<user name>/).
Notes:
-
The Pm.DiscGetPath method can be used for conversion from PROMOTIC format path to Microsoft format path.
- Up to the version
Pm8.3.4 the PROMOTIC path format has been defined
by the $.path macro expression. But based on user experiance analysis it has been decided to define paths without the use of the macro expression. The
$.path macro expression is still functional, but its usage is recommended only in special cases, if creation of Microsoft path is needed inside the compounded macro expression.