EasyCFM.COM ColdFusion Forums / ASP to CFML / Need help modifying this to cfm

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Need help modifying this to cfm

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

katg
09-16-2004 @ 9:12 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 8
Joined: May 2004

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

CFMLInterpreterImp::executePCode

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>
<html>
<head>
<title>
<body>
<cfinclude template="../includes/bodyTop.asp">
the output from the table which has nothing to do with the includes
</body>
</html>


The include at the top is this:

<%
dim randomColor, color

' begin random function
randomize

' select a random number between one and five
randomColor=int(rnd*5)+1

' 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="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,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="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
</object>
</td>
</tr>
<tr bgcolor="#ffffff">
<td width="200" valign="top" bgcolor="<%= color1 %>">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,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="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
</object>



<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,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="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
</object>
</td>
<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.

Thanks


Webmaster
09-16-2004 @ 12:34 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4542
Joined: Jan 2002

This would be what you'd need on the first page;

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

   [ CONTINUE YOUR CFCASE values here ]    

</cfswitch>


Then on the other page, where you have this:

bgcolor="<%= color1 %>">

Then you will need this:

<cfoutput>#tColor1#</cfoutput>

That should get ya going!

Thanks,
Pablo Varando
Team Macromedia Member
=====================================================

katg
09-21-2004 @ 12:10 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 8
Joined: May 2004

Pablo,

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


Website Designed and Developed by Pablo Varando.