Introduction to pcGRASP - Templates

File | Edit | View | Templates | Project | Compiler | Run | Windows | Help

The Templates menu is used to insert pre-typed blocks of code into the CSD editor window. These templates facilitate the rapid building of skeletal programs in which details are inserted at place holders to form a completed program. By using the Floating Menu option, the templates menu becomes a free-standing window, allowing for easy multiple use of the templates. The default menu in each CSD window contains the major constructs used by that particular language.

The user may cusomize the templates menu so that common sections of code that an individual may use, such as file header information or a layout for subprogram headers, may be added. This is achieved by creating text files in the directory GRASP_HOME\templates. Files with the extension .ada95 are used exclusively in the Ada 95 CSD window's templates menu. Similarly, files with the extension .c, .cpp, .java and .vhdl are used exclusively for the C, C++, Java and VHDL windows, respectively. Filenames with any other extension are used in the CSD window of all supported languages. Template files must follow the format shown below.

!menu_name

#block_name1
<_
insert your custom block here (any text)
_>

#block_name2
<_
insert your custom block here (any text)
_>

#block_name3
<_
insert your custom block here (any text)
_>

The control strings ! # <_ _> must be left aligned. Lines of text that do not begin with ! or # and are not between <_ and _> will be ignored by GRASP.

Return to the Introduction to GRASP Page