GRASP - CSD Window (C++) : Templates

File | Edit | View | Templates | Windows | Compiler | Run | C/C++ | Help

The templates menu is used to insert pre-typed blocks of code into the CSD window at the current cursor location. These templates allow the user to quickly build skeletal programs in which details are inserted at place holders to form a completed program. By using the tear-off option (the dashed line at the top of the template menu) the template menu itself becomes a free-standing window, allowing easy multiple use of the tempaltes. The default menu contains the major C constructs.

Additionally, a user may add custom templates to the templates menu by placing menu files in the directory .grasp/templates. The format for these menu files is as follows:

!menu_name

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

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

#block_name3
<_
insert your custome 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.

Template file names with the extension .c will be used exclusively for the C CSD window. (Template files with .ada95 and .java extensions will be used exclusively in the Ada 95 and Java CSD windows, respectively.) The default template files are located in $GRASP_HOME/templates.

Return to the Introduction to GRASP Page