Variables

Design-time constants are similar to session variables, but instead of being converted to values at run time, design-time constants get converted at build time. We call them design-time constants because the names you give them only exist at design time. At build time, the name of each design-time constant is replaced by the value that was assigned to it.

Tip: You can also define custom design-time constants by choosing Publish > Settings... from the program menu and selecting the Constants tab.

The following design-time constants are available in Visual Patch:

#ASC????#

This is a special set of design-time constants. When a constant's name starts with "#ASC", Visual Patch interprets the value assigned to that constant as the ASCII value of a character. Wherever you use that constant, Visual Patch replaces the constant's name with the corresponding character.

For example, if you create a design-time constant named #ASC_QUOTE# and assign the value "34" to it, Visual Patch would replace each occurrence of #ASC_QUOTE# in your project with the character whose ASCII number is 34, i.e., a quotation mark ("). Or, you could create a design-time constant to represent the null character (ASCII value 0) by assigning the value "0" to "#ASCNULL#".

#COMMONFILESDIR#

The Common Files folder on your development system. Typically, this is something like: C:\Program Files\Common Files.

#CURRENTDAY#

A number representing the current day of the month, calculated when the patch executable is built.

#CURRENTHOUR#

A number representing the current hour in 24-hour time (e.g. 4:00 PM is 16), calculated when the patch executable is built.

#CURRENTMINUTE#

The current minute, calculated when the patch executable is built. This number is always expressed with two digits, so 4 minutes into the hour will be "04".

#CURRENTMONTH#

A number representing the current month, calculated when the patch executable is built. January is represented by "1" and December is represented by "12".

#CURRENTMONTH2#

A two-digit number representing the current month, calculated when the patch executable is built. January is represented by "01" and December is represented by "12".

#CURRENTSECOND#

The current second, calculated when the patch executable is built. This number is always expressed with two digits, so 4 seconds into the minute will be "04".

#CURRENTYEAR#

The four-digit number representing the current year, calculated when the patch executable is built.

#DATE#

The current date on your development system when the patch executable is built. It's in the format MM/DD/YY. So, if you built the patch on April 23, 2005, #DATE# would be "04/23/05".

#EUROPEANDATE#

The current date on your development system when the patch executable is built, in the European dating format: DD/MM/YY. For example, if you built the patch on April 23, 2005, #EUROPEANDATE# would be "23/04/05".

#ISODATE#

The current date on your development system when the patch executable is built, in the ISO format: YYYY-MM-DD. For example, if you built the patch on April 23, 2005, #ISODATE# would be "2005-04-23".

#JULIANDATE#

The current date on your development system when the patch executable is built, in the form of an integer value representing the number of days since midnight on January 1, 4713 B.C.

You can use #JULIANDATE# along with the built-in variable %JulianDate% to build patches that expire a certain number of days after they are created. To calculate the number of days that have elapsed since the patch executable was generated, use the formula %JulianDate% - #JULIANDATE#.

#NEWESTVERSION#

The name of the newest version in your current build. This value is dynamically defined at build time.

#OLDESTVERSION#

The name of the oldest version in your current build. This value is dynamically defined at build time.

#PROGRAMFILESDIR#

The path to the Program Files directory on your development system.

#PROJECTFILEDIR#

This is the path to the Visual Patch project (.VP2) file that you are currently editing. Your project file must be saved in order for this variable to be properly set. If you have not saved your document, this constant will be set to "C:" by default.

This constant is useful if you want to keep your project (.VP2) file and the files in your patch in the same directory. That way you can set #PROJECTFILEDIR# as the files' source directory and your project will be portable to different development systems where paths and drives may change.

#VPDIR#

The path to the directory where Visual Patch is installed on your development system. Usually this will be "C:\Program Files\Visual Patch 3.0".

#SYSDIR#

The path to the system directory on your development system.

#VERSIONTABNAME#

This constant expands to the name of the current version tab. It should only be used in the file properties area and will not expand in any other areas of the program.

#WINDIR#

The path to the Windows directory on your development system.