Transfer Macros

From RAD Studio
Jump to: navigation, search

Go Up to Tool Properties


Tools > Configure Tools > Add > Macros
Tools > Configure Tools > Edit > Macros

Use transfer macros to supply startup parameters to a program on the Tools menu.

Macro Description

$COL

Expands to the column number of the cursor in the active Code editor window. For example, if the cursor is in column 50, at startup the product passes 50 to the program.

$ROW

Expands to the row number of the cursor in the active Code editor window. For example, if the cursor is in row 8, at startup the product passes 8 to the program.

$CURTOKEN

Expands to the word at the cursor in the active Code editor window. For example, if the cursor is on the word Token, at startup the product passes Token to the program.

$PATH

Expands to the directory portion of a parameter you specify. When you insert the $PATH macro, the product inserts $PATH() and you specify a parameter within the parentheses. For example, if you specify $PATH($EDNAME), at startup the product passes the path for the file in the active Code editor window to the program.

$NAME

Expands to the file name portion of a parameter you specify. When you insert the $NAME macro, the product inserts $NAME() and you specify a parameter within the parentheses. For example, if you specify $NAME($EDNAME), at startup the product passes the file name for the file in the active Code editor window to the program.

$NAMEONLY

Expands to the file name portion of a parameter you specify, without an extension. When you insert the $NAMEONLY macro, the product inserts $NAMEONLY() and you specify a parameter within the parentheses.

$EXT

Expands to the file extension portion of a parameter you specify. When you insert the $EXT macro, the product inserts $EXT() and you specify a parameter within the parentheses. For example, if you specify $EXT($EDNAME), at startup the product passes the file extension for the file in the active Code editor window to the program.

$EDNAME

Expands to the full file name of the active Code editor window. For example, if you are editing the file C:\PROJ1\UNIT1.PAS, at startup the product passes C:\PROJ1\UNIT1.PAS to the program.

$EXENAME

Expands to the full file name of the current project target. For example, if you are working on the project PROJECT1 in C:\PROJ1, at startup the product passes C:\PROJ1\PROJECT1.EXE to the program. If you are working on a package project PACKAGE1 in C:\PACKAGE, at startup the product passes C:\PACKAGE\PACKAGE1.BPL to the program.

$HOSTNAME

Expands to the full file name of the executable which is run for the current project. For .executable projects, this macro is equivalent to the $EXENAME macro. For package and DLL projects, this macro expands to the project's host application as defined on the Run|Parameters dialog box. For example, if you are working on the project PROJECT1 in C:\PROJ1, at startup the product passes C:\PROJ1\PROJECT1.EXE to the program. If you are working on a package project called PACKAGE1 in C:\PACKAGE, and the host application is set to C:\HOST\HOSTAPP.EXE at startup the product passes "C:\HOST\HOSTAPP.EXE" to the program (rather than the package name "C:\PACKAGE\PACKAGE1.BPL").

$PARAMS

Expands to the command-line parameters specified in the Debugger options page.

$PROMPT

Prompts you for parameters at startup. When you insert the $PROMPT macro, the product inserts $PROMPT() and you specify a default parameter within the parentheses.

$SAVE

Saves the active file in the Code Editor.

$SAVEALL

Saves the current project.

$TDW

Sets up your environment for running Turbo Debugger. For example, this macro saves your project, ensures that your project is compiled with debug info turned on, and recompiles your project if it is not compiled with debug info turned on. Be sure to use this macro if you add Turbo Debugger to the Tools menu.