Topic: Need help modifying this to cfm

katg    -- 09-16-2004 @ 9:12 AM
  In the process of putting cfm files into a new look and feel for a site. The problem is the header, footer and nav files are ASP files and appear to have variables in them which is why I believe I am getting the following error:

out_of_range: invalid vector subscript


Once I get this error, cfm appears to halt and everything cfm becomes unresponsive.

If I take those ASP files out, my page works fine. I don't know of any way for cfm to read asp pages with variables in them so I need to get this code converted to cfm and I haven't a clue.

My cfm page basically is this:

<cfinclude template="../includes/randomTDColors.asp">
<cfquery name="the query>
<cfinclude template="../includes/bodyTop.asp">
the output from the table which has nothing to do with the includes

The include at the top is this:

dim randomColor, color

' begin random function

' select a random number between one and five

' Based on the random number, the following select case will assign a color to be displayed
select case randomColor
' blue
case "1"
color1 = "003366"
color2 = "25507c"
' green
case "2"
color1 = "006633"
color2 = "257c50"
' orange
case "3"
color1 = "CC3300"
color2 = "d35025"
' purple
case "4"
color1 = "663399"
color2 = "7c50a7"
' red
case else
color1 = "660000"
color2 = "7c2525"
' blue
'case "1"
'color ="003366"
' green
'case "2"
'color ="006633"
' orange
'case "3"
'color ="CC3300"
' purple
'case "4"
'color ="663399"
' red
'case else
'color ="660000"
end select

And the other include looks like this:

<table width="100%" height="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#999999">
<tr bgcolor="#ffffff">
<td width="200" height="100" valign="top" bgcolor="<%= color1 %>"><img border="0" src="/IOC/images/iocLogo<%= color1 %>.gif"></td>
<td valign="top" bgcolor="<%= color2 %>">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=",0,29,0" width="800" height="100">
<param name="movie" value="/IOC/flash/iocBanner.swf">
<param name="quality" value="high">
<param name="wmode" value="transparent">
<embed src="/IOC/flash/iocBanner.swf" width="800" height="100" quality="high" pluginspage="" type="application/x-shockwave-flash"></embed>
<tr bgcolor="#ffffff">
<td width="200" valign="top" bgcolor="<%= color1 %>">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=",0,29,0" width="200" height="700">
<param name="movie" value="/IOC/flash/iocMenuSDT.swf?menuAddress=<%= request.ServerVariables("URL") %>">
<param name="quality" value="high">
<param name="wmode" value="transparent">
<embed src="/IOC/flash/iocMenuSDT.swf?menuAddress=<%= request.ServerVariables("URL") %> width="200" height="700" quality="high" pluginspage="" type="application/x-shockwave-flash"></embed>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=",0,29,0" width="200" height="100">
<param name="movie" value="/IOC/flash/iocNews.swf">
<param name="quality" value="high">
<param name="wmode" value="transparent">
<embed src="/IOC/flash/iocNews.swf\ width="200" height="100" quality="high" pluginspage="" type="application/x-shockwave-flash"></embed>
<td valign="top">
<table width="100%" height="100%" border="0" cellspacing="1" cellpadding="20" bgcolor="<%= color2 %>">
<tr bgcolor="#FFFFFF">
<td valign="top">

Any help would be greatly appreciated.


Webmaster    -- 09-16-2004 @ 12:34 PM
  This would be what you'd need on the first page;

<cfswitch expression="#RandRange()#">
   <cfcase value="1">
       <cfset tColor1 = "003366">
       <cfset tColor2 = "25507c">
   <cfcase value="2">
       <cfset tColor1 = "006633">
       <cfset tColor2 = "257c50">

   [ CONTINUE YOUR CFCASE values here ]    


Then on the other page, where you have this:

bgcolor="<%= color1 %>">

Then you will need this:


That should get ya going!

Pablo Varando
Team Macromedia Member

katg    -- 09-21-2004 @ 12:10 PM

Thanks so much for your help.  I got it working.

EasyCFM.COM ColdFusion Forums :