Du befindest Dich im Archiv vom ABAKUS Online Marketing Forum. Hier kannst Du Dich für das Forum mit den aktuellen Beiträgen registrieren.

Eindimensionale Array in [b]Coldfusion[/b]

Ajax, Hijax, Microformats, RDF, Markup, HTML, PHP, CSS, MySQL, htaccess, robots.txt, CGI, Java, Javascript usw.
Neues Thema Antworten
alesis
PostRank 2
PostRank 2
Beiträge: 36
Registriert: 14.03.2004, 23:20
Wohnort: Olten

Beitrag von alesis » 28.10.2004, 18:06

Hallo Leute...

Ich habe ein kleines Problem, für euch bestimmt ein Kinderspiel.
Ich habe soeben versucht aus einem Buch ein Beispielscript auszuprobieren.
Ich versuche ein Array mit Informationen zu füttern um Sie anschliessend mit <cfoutput>
Heraus zu ziehen.

Hier mein Script:

<cfset dim1=ArrayNew(1)/>
<cfset dim1=[1]="hallo">
<cfset dim1=[2]="Velo">
<cfset dim1=[3]="test">



<cfoutput>#dim1[1]#</cfoutput>

Kann mir irgendjemand sagen, was ich falsch mache??

Vielen Dank für jede Hilfe!

Gruss Alesis

Anzeige von ABAKUS

von Anzeige von ABAKUS »

Content Erstellung von ABAKUS Internet Marketing
Ihre Vorteile:
  • einzigartige Texte
  • suchmaschinenoptimierte Inhalte
  • eine sinnvolle Content-Strategie
  • Beratung und Umsetzung
Jetzt anfragen: 0511 / 300325-0

innuendo
PostRank 8
PostRank 8
Beiträge: 776
Registriert: 13.06.2003, 14:18
Wohnort: Linz/OÖ

Beitrag von innuendo » 28.10.2004, 19:32

Hi,

sieh dir dieses Beispiel von hier an:https://livedocs.macromedia.com/coldfus ... tm#1100696

<!--- This example shows ArrayNew --->
<html>
<head>
<title>ArrayNew </title>
</head>

<body>
<H3>ArrayNew Example</H3>

<!--- Make an array --->
<cfset MyNewArray = ArrayNew(1)>
<!--- ArrayToList will not function properly if the Array has not been
initialized with ArraySet --->
<cfset temp = ArraySet(MyNewArray, 1,6, "")>

<!--- set some elements --->
<cfset MyNewArray[1] = "Sample Value">
<cfset MyNewArray[3] = "43">
<cfset MyNewArray[6] = "Another Value">

<!--- is it an array? --->
<cfoutput>
<P>Is this an array? #IsArray(MyNewArray)#
<P>It has #ArrayLen(MyNewArray)# elements.
<P>Contents: #ArrayToList(MyNewArray)#
<!--- the array has expanded dynamically to six elements
with the use of ArraySet, even though we only set three values --->

</cfoutput>
</body>
</html>


Siehst du den Unterschied?

lg,
Innuendo

Antworten