Author Topic: Make a user defined comment as the template  (Read 5829 times)

davidlee62

  • Community Member
  • Posts: 35
  • Hero Points: 1
Make a user defined comment as the template
« on: November 18, 2006, 08:22:03 AM »
Hi All,

Want to add a comment phase in the source file top, please advice how to do it.  I'm new in SlickEdit, want to use it program C code, my current version is 11.0. Thanks.


David

Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Re: Make a user defined comment as the template
« Reply #1 on: November 18, 2006, 01:40:46 PM »
I use an alias to create my file header.

Tools->Options->File Extension->General->Aliases.

I have an alias named 'hdr' that expands to something like this:
Code: [Select]
/*****************************************************************
*       Copyright (c) 2004 - 2007, MEGA CORPORATION
*       All  rights reserved.
*       Confidential Property of MEGA CORPORATION
*
* $Workfile:  $
* $Revision:  $
* $Modtime:  $
*
* $Log: $
*
* Description: %(Description)
*
****************************************************************/
Note that the macro prompts the user to fill in the Description.
There is probably a way to hook this up to run automatically when you create new files of a certain type.

Or is this not what you meant?



davidlee62

  • Community Member
  • Posts: 35
  • Hero Points: 1
Re: Make a user defined comment as the template
« Reply #2 on: November 20, 2006, 02:05:40 AM »
Hi Wanderer,

Yes, this is what I want. By the way, SlickEdit has providered a template using XML format, I'd like to know if it also be the same object? Thanks.


David

davidlee62

  • Community Member
  • Posts: 35
  • Hero Points: 1
Re: Make a user defined comment as the template
« Reply #3 on: November 20, 2006, 03:04:56 AM »
I use an alias to create my file header.

Tools->Options->File Extension->General->Aliases.

I have an alias named 'hdr' that expands to something like this:
Code: [Select]
/*****************************************************************
*       Copyright (c) 2004 - 2007, MEGA CORPORATION
*       All  rights reserved.
*       Confidential Property of MEGA CORPORATION
*
* $Workfile:  $
* $Revision:  $
* $Modtime:  $
*
* $Log: $
*
* Description: %(Description)
*
****************************************************************/
Note that the macro prompts the user to fill in the Description.
There is probably a way to hook this up to run automatically when you create new files of a certain type.

Or is this not what you meant?




Hi Wanderer,

I am not sure the Macro usage, e.g, if I want to insert a date text string, where can i create the variable for referrence? Could you advise a details of how to use the "Ailas Editor" ? Thanks.

David