Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

variable names including hyphens

Posted on 2001-06-15
2
Medium Priority
?
220 Views
Last Modified: 2013-12-24
Hi Folks,

i am up against a problem involving variable names with hyphens.  unfortunately it is not as simple as redefining the variables without hyphens because these come out of active directory LDAP queries.

the basic script is like:

=========================================================
<cfoutput>
<cfset attributes = "dn,E-mail-Addresses">

<CFLDAP NAME="ListAccounts"
    SERVER="#server#"
    PORT="389"
    USERNAME="#NT_DOM#\Administrator"
    PASSWORD="#passwd#"
    ACTION="query"
    START="CN=Recipients,dc=company,dc=com"
    SCOPE="OneLevel"
    ATTRIBUTES="#Attributes#"
    TIMEOUT="320"
    >

found #listaccounts.recordcount# entries.

<p>List of Entries:<br>
<table>
<tr>
<cfloop list="#attributes#" index="att">
<td>#att#</td>
</cfloop>
</tr>
<cfloop query=listaccounts>

<tr>
<cfloop list="#attributes#" index="att">
<td>#evaluate("listaccounts.#att#")#</td>
</cfloop>
</tr>

</cfloop>
</table>

</cfoutput>
=========================================================

which produces the quite predictable error:

=========================================================
An error has occurred while processing the expression:

listaccounts.E-Mail-Addresses

Error resolving parameter LISTACCOUNTS.E
=========================================================

anyone aware of a work-around to this problem?

cheers.


0
Comment
Question by:meverest
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
CF_Spike earned 600 total points
ID: 6198494
You can normally get around this by using array notation instead of dot notation to access the variable.

i.e. #evaluate("listaccounts.#att#")# can be rewritten as #listaccounts['att'][listaccounts.currentrow]# when looping through the query.

Spike
0
 
LVL 37

Author Comment

by:meverest
ID: 6200494
Thanks,

specifically, this diod the trick:

<td>#listaccounts['#att#'][listaccounts.currentrow]#</td>

Cheers.
0

Featured Post

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

671 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question