Commenting a script

Tool for Search and Replace across multiple files.
Post Reply
ebulerdo
Posts: 18
Joined: Mon Dec 09, 2013 8:54 am

Commenting a script

Post by ebulerdo »

Hi! I usually edit my scripts with a text editor. In the old TextCrawl format I used to comment some lines at the beginning to add a brief explanation and instructions. For example:

// Numbers to months
// This script converts numbers to months. E.g. #01 to January
// Make sure to use UTF8 enconding.

How can I do something similar in the current format? I know how to comment a command using the <comments> tag, but how can I comment at the beginning of the script? Thanks!
User avatar
DigitalVolcano
Site Admin
Posts: 1731
Joined: Thu Jun 09, 2011 10:04 am

Re: Commenting a script

Post by DigitalVolcano »

The files are in XML format, so you can use XML comments:

Code: Select all

<?xml version="1.0" encoding="utf-16"?>
<!--Your comment-->
<TextCrawlerBatch Version="3.0">
  <command name="SubFoldersOn" enabled="True" />
  <command name="FindRep" enabled="True">
........
Note that you have to have the <?xml.. declaration as the first line else it won't load. The comments will be lost if you re-save it from TextCrawler!
ebulerdo
Posts: 18
Joined: Mon Dec 09, 2013 8:54 am

Re: Commenting a script

Post by ebulerdo »

Thanks! That's exactly what I need.
Post Reply