Ask a Question related to Macromedia ColdFusion, Design and Development.
-
alien3d #1
array and struct
why went we push an array it get change to struct ?
and why cannot loop on struct variable when the struct variable are number
e.g main.1.input main.2.input
alien3d Guest
-
Array element doesn't keep struct value?
I'd like each of the following array elements to hold its own structure. <cfset TeamMemberDisplay = arraynew(1)> <cfset querystuct = structnew()>... -
Issues with declaring struct arrays inside of a struct
I have the following C++ code: define MAXXPAXX 64 // Pack sub component of database struct. typedef PREFIX_PACKED struct { DWORD packid;... -
Calling fun taking struct and not pointer to struct?
Robert Feldt wrote: I'm a little confused by the question... are you asking if: 1) The act of using a struct in the declaration of another... -
Fwd: Calling fun taking struct and not pointer to struct?
Related to the recent thread about nested structs and Ruby/DL here is the answer from Ruby/DL's author: So that's what I ask you: Is inlining... -
"struct" vs. assoc. array
Hi all, to handle a collection of data, I could use an associative array or a class. Provided I don't need any of the functionalities classes... -
Stressed_Simon #2
Re: array and struct
What do you mean when you push an Array????
And you can loop through a struct if its reference is a number:-
<cfoutput>
<cfloop from="1" to="10" index="num">
#main.input#
</cfloop>
</cfoutput>
Stressed_Simon Guest
-
alien3d #3
Re: array and struct
What i mean are like this
<cfquery=xxxxx>
anything[][][]=#table.user#
</cfquery>
Actually when we push or append and array it change to struct to prevent it i
change the array to struct but when i want to loop it the struct the struct
would not loop because it can't loop number as reference on would loop struct
as word only e.g name_struct.1.x the number 1 couldn['t loop and it saz
bla.......
alien3d Guest
-
alien3d #4
Re: array and struct
Here are the code
<cfset kalendar=ArrayNew(2)>
<cfset kalendar=structNew()>
<cfset x=0>
<cfinvoke
component="cfm.Connections.database"
method="getRecordset1"
returnvariable="getRecordset1Ret">
<cfinvokeargument name="user" value="#url.user#"/>
<cfinvokeargument name="type" value="#url.type#"/>
<cfinvokeargument name="dateReceived" value="#tarikh#"/>
<cfinvokeargument name="dateReceivedTwo" value="#dateReceivedTwo#" />
</cfinvoke>
<!--- other language may define array starting from 0 but cold fusion are
starting 1 weird --->
<!--- major problem on array because it cannot loop counter inside query
tag why why--->
<!--- her more joke since array start from zero why waste to delete array
number time again ? --->
<cfoutput query="getRecordset1Ret">
<cfloop index="i" from="0" to="23" >
<cfif hour("#start_activity#") eq i>
<cfset i=i+1>
<!--- asumed 24 hour eq to midnight i equal to 24 hour and j are total
array inside i hour --->
<cfset x=x+1>
<cfset kalendar.id="#id#">
<cfset kalendar.user="#user#">
<cfset kalendar.activity="#activity#">
<cfset kalendar.event_type="#event_type#">
<cfset kalendar.calendar_type="#calendar_type#">
<cfset kalendar.start_activity="#start_activity#">
<cfset kalendar.end_activity="#end_activity#">
</cfif>
</cfloop>
</cfoutput>
<cfinclude template="include/array_time.cfm">
<!--- setting akan dibina --->
<!--- actuall i want to make more loop to simplyfy the code but cannot
since Cold
fusion complain cannot translate complex object into simple variable form
?????
Is there any bbcode tag for cfml ? Struct Find ? totally weird way to pull
out output
One activity per time only since cold fusion convert add value to array is
struct do no why ???
--->
<cfloop index="i" from="1" to="24">
<tr <cfif (i mod 2) eq 1>bgcolor="##b0b3cf"</cfif>>
<td width="61">#masa[normal_clock]# </td>
<td width="323" valign="top" align="left"><cfloop collection =
#kalendar.activity# item = "value1">
<cfif value1 eq i>
#StructFind(kalendar.activity,value1)#
</cfif>
</cfloop>
<br />
<cfloop collection = #kalendar.user# item = "value">
<cfif value eq i>
<b>Di Hantar oleh : #StructFind(kalendar.user,value)#</b>
</cfif>
</cfloop></td>
</tr>
</cfloop>
alien3d Guest



Reply With Quote

