Take a few minutes and browse through a Tour of CFM2ASP: |
|
If you have already downloaded
CFM2ASP you can follow along with your copy. Otherwise
notice the screen shots as we step through each
feature. |
|
|
First we want to see the conversion. All you have
to do is open a CFM file and the program will
automatically convert it to ASP. There is an option
to open a file without converting but we'll get
to that later. So the first thing we need to do
is open a file by going to the "File
menu" and clicking "Open".
After opening the file you will have to wait briefly
while the CFM is converted. While waiting for
the conversion to finish you may be faced with
a dialog box like this .
If so don't worry, this is what happens when the
conversion finds a variable or a function that
it isn't sure what to do with. You can choose
a type of variable that it is, or select a query
that it is part of. Or click skip to wait until
the conversion is done to figure it out.
|
|
|
Now that you have converted your first page
you need to know how to save the ASP. It's
as easy as selecting the ASP tab and then
clicking "Save" in the
"File menu". If the CFM
tab is selected it will save the CFM code.
You will also notice that the ASP filename
is automatically filled in by taking the
CFM file name and changing the .cfm to .asp
this will help you keep the web site organized
the same as before the conversion.
|
|
|
The
next feature we will look at is the "Search
and Replace" function. CFM2ASP allows
regular expression search and replace which can
be very powerful if you know how to use it. We
will walk though an example but to get the full
use of it you may need to read more about Regular
Expressions. This function can be found in the
"Edit menu". 
Notice the enlarged
view; if you are following along on your computer
enter the Regular Expression that is shown. Under
Find put (<.*>) and in the Replace With
field put <!-- $1 --> Select "Verify
Before Replace" and "Use Regular Expression".
Then click GO. If your currently loaded page has
any tags on it at all you should now be faced
with something like this .
Click "Yes" and the <cfquery ...> tag that
was highlighted (or whatever tag was highlighted
on yours) should now be inside comment tags. .
The search and replace function can also be used
as an ordinary search and replace that you would
see in any text editor but to unleash the real
power here you will want to learn about Regular
Expressions.
|
|
|
You also have control
over the "Format" of
your Code. Notice under the "Edit
menu" the Format Code item. This allows
you to toggle between left justification and the
much more readable formatted code. The Code Formatter
by default indents when it finds a Table tag;
which includes <table>, <tr>, and
<td>. Other tags that are indented for are
List and a few other block type tags .
Look at the enlarged
view for a side by side comparison of formatted
and left justified. The Code formatter has several
options that you can adjust for your preferred
formatting. If Code Formatting is turned on the
ASP code will automatically be formatted when
it is converted.
|
|