You didn't scope these two variables to be Session variables...
Change them to be:

<cfset Session.stDirFileName[RecNo] = Name>
<cfset Session.stDirFileSize[RecNo] = Size>

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, September 25, 2001 10:11 AM
Subject: Re: Passing the results from the <CFDIRECTORY to another template?


> Hi Bruce,
>
> Could there be a syntax error in the code below? This is the error I keep
> getting. Below the error I've attached my test file. I've removed the
> javascript for the popup menu. I want to get your code working first. If I
> comment out these two lines it runs ok.
>
> <cfset stDirFileName[RecNo] = Name>
> <cfset stDirFileSize[RecNo] = Size>
>
>
>
> Error Occurred While Processing Request
> Error Diagnostic InformationAn error occurred while evaluating the
> expression:  stDirFileName[RecNo] = NameError near line 121, column 20.
> Error resolving parameter STDIRFILENAME ColdFusion was unable to determine
> the value of the parameter. This problem is very likely due to the fact
> that either: You have misspelled the parameter name, or You have not
> specified a QUERY attribute for a CFOUTPUT, CFMAIL, or CFTABLE tag.The
> error occurred while processing an element with a general identifier of
> (CFSET), occupying document position (121:1) to (121:35).Date/Time:
> 09/25/01 13:10:18
> Browser: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)
> Remote Address: 192.139.241.145
>
>
> <mycode>
>
> <html>
>
> <head>
>          <meta http-equiv="content-type"
> content="text/html;charset=iso-8859-1">
>          <title>Test</title>
>
>
>          <script language="JavaScript" type="text/javascript">
>          <!--
>                  NS4 = (document.layers);
>                   IE4 = (document.all);
>                  ver4 = (NS4 || IE4);
>                           IE5 = (IE4 &&
> navigator.appVersion.indexOf("5.")!=-1);
>                     isMac = (navigator.appVersion.indexOf("Mac") != -1);
>                    isMenu = (NS4 || (IE4 && !isMac) || (IE5 && isMac));
>                  function popUp(){return};
>                  function popDown(){return};
>                  function startIt(){return};
>                  if (!ver4) event=null;
>          //-->
>          </script>
> </head>
>
> <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0"
> marginwidth="0" marginheight="0" link="#0000FF" vlink="#0000FF"
> alink="#0000FF">
>
> <link rel="STYLESHEET" type="text/css"
> href="<cfoutput>#stylesheets#styles.css</cfoutput>">
>
>
> <cfparam name="dir" default="d:\books\aosl">
>
> <cfoutput>
> <cfdirectory action="LIST" directory="#dir#" name="dirlist">
> </cfoutput>
>
> <cfset Session.stDirFileName = StructNew()>
> <cfset Session.stDirFileSize = StructNew()>
>
> <cfset RecNo=1>
>
> <cfoutput query="dirlist">
>
> <cfset stDirFileName[RecNo] = Name>
> <cfset stDirFileSize[RecNo] = Size>
>
> <cfif type eq "File">
> <table border="0" cellpadding="0" cellspacing="0" width="100%"
height="20">
> <tr height="20">
> <td>#indent#</td>
> <td width="18" height="20"></td>
> <td valign="middle" width="100%" height="20">
>          <cfset icon_image = "images/file1.gif">
>          <a href="fileinfo.cfm?#name#" title="Left Click here..."
> onMouseOver="popUp('HM_Menu3',event)" onMouseOut="popDown('HM_Menu3')"
> class="dirlinks" alt="#name#">
>          <img valign="middle" src="#icon_image#" border="0"><font
> class="dirlinks">#name#</font></a><br>
> </td>
> </tr>
> </table>
> </cfif>
> </cfoutput>
>
> </body>
>
> </html>
> </mycode>
>
>
>
>
> At 11:44 AM 9/24/01 -0700, you wrote:
> >Make sure you have session management activated...then
> >
> ><cfdirectory name="queryName" ...>
> >
> ><!--- Create a new structure for each column of info you want --->
> ><cfset Session.stDirFileName = StructNew()>
> ><cfset Session.stDirFileSize = StructNew()>
> >
> ><cfset RecNo=1><!--- set an index counter --->
> ><cfoutput query="queryName">
> >     <cfset stDirFileName[RecNo] = Name>
> >     <cfset stDirFileSize[RecNo] = Size>
> >     ...
> >     <cfset RecNo=RecNo + 1>
> ></cfoutput>
> >
> >Then on your other template page...
> >
> >The directory listing is:<br>
> ><!--- loop from 1 to the number of keys in the structure --->
> ><cfloop index="RecNo" from=1 to=#ListLen(StructKeyList(stDirFileName))#>
> >     #stDirFileName[RecNo]# #stDirFileSize[RecNo]#<br>
> ></cfloop>
> >
> >Give that a whirl...this has not been tested, but should give you the
idea
> >on how to complete it.
> >
> >Bruce
> >[EMAIL PROTECTED]
> >
> >----- Original Message -----
> >From: <[EMAIL PROTECTED]>
> >To: "CF-Talk" <[EMAIL PROTECTED]>
> >Sent: Monday, September 24, 2001 10:32 AM
> >Subject: Re: Passing the results from the <CFDIRECTORY to another
template?
> >
> >
> > > At 10:28 AM 9/24/01 -0700, you wrote:
> > > >There are multiple ways to pass it.  What directory info are you
wanting
> >to
> > > >pass?
> > >
> > >
> > > All the information from the <CFDIRECTORY> Name, Type etc.
> > >
> > > >You can pass info from one template to another via:
> > > >     Session vars
> > > >     Client vars
> > > >     Application vars
> > > >     Form fields
> > > >     URL parameters
> > > >     etc
> > > >
> > > >You may want to store the directory info you want into a structure or
> >array,
> > > >scope it as a Session variable, then reference it on the next
template.
> > >
> > > Yikes. How do I do that?
> > >
> > >
> > > >Bruce
> > > >[EMAIL PROTECTED]
> > > >
> > > >----- Original Message -----
> > > >From: <[EMAIL PROTECTED]>
> > > >To: "CF-Talk" <[EMAIL PROTECTED]>
> > > >Sent: Monday, September 24, 2001 10:00 AM
> > > >Subject: Re: Passing the results from the <CFDIRECTORY to another
> >template?
> > > >
> > > >
> > > > > How can I pass the results from the <CFDIRECTORY to another
template?
> > > > >
> > > > > Name
> > > > > Size
> > > > > Type..etc
> > > > >
> > > >
> > >
> >
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to