Advertisement

08.11.2008 at 06:13AM PDT, ID: 23637706
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.0

The element at position 43 of dimension 1, of array variable "MONTHARRAY," cannot be found.

Asked by jramos74 in Cold Fusion Markup Language, ColdFusion Application Server

Tags:

I have created a calendar site.  But I am getting an error message for the month of October 2008.  I am not sure what am I doing wrong.

Here is the error message:  The element at position 43 of dimension 1, of array variable "MONTHARRAY," cannot be found.  
 
 
The error occurred in C:\Inetpub\wwwroot\Investigations\duty_agent\cal.cfm: line 159
 
157 :             </cfif> --->>
158 :             
159 :             <cfif MonthArray[pos] gt 0>
160 :                   <cfoutput>
161 :                   <a href="javascript:void()" onclick=
 
Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<script language="JavaScript" src="/investigations/overlib.js"><!-- overLIB (c) Erik Bosrup --></script>
<script language="JavaScript">
	var ol_textfont = "Arial, Helvetica, sans-serif";
	var ol_fgcolor  = "WHITE";
</script>
<cfparam name="change_staff" default="#session.user.id#">
<!--- OVERLIB CODE END HERE --->
<cfset thistoday = now()>
<CFSET thisYear = Year(thistoday)>
<CFSET thisMonth = Month(thistoday)>
<CFSET thisDay = Day(thistoday)>
<cfif isdefined("month")>
	<cfset Today = CreateDateTime(year, month, 1, 0, 0, 0)>
<cfelse>
	<cfset Today = now()>
</cfif>
 
<CFSET CurrYear = Year(Today)>
<CFSET CurrMonth = Month(Today)>
<CFSET CurrDay = Day(Today)>
<cfif currmonth is 1>
	<cfset prevmonth = 12>
	<cfset nextmonth = currmonth + 1>
	<cfset prevyear = curryear - 1>
	<cfset nextyear = curryear>
<cfelseif currmonth is 12>
	<cfset prevmonth = currmonth -1>
	<cfset nextmonth = 1>
	<cfset prevyear = curryear>
	<cfset nextyear = curryear + 1>
<cfelse>
	<cfset prevmonth = currmonth -1>
	<cfset nextmonth = currmonth + 1>
	<cfset prevyear = curryear>
	<cfset nextyear = curryear>
</cfif>
 
<CFSET firstofmonth = CreateDateTime(CurrYear, CurrMonth, 1, 0, 0, 0)>
 
<cfset startday = DayOfWeek(firstofmonth) + 2>
<cfif startday GT 7>
	<cfset startday = startday - 7>
</cfif>
 
<cfset numberofdays = DaysInMonth(Today)>
<cfset days = numberofdays + startday - 1>
 
<CFSET MonthArray = ArrayNew(1)>
<cfset temp = ArrayResize(MonthArray,42)>
<cfset temp = ArraySet(MonthArray,1,42,0)>
<cfset dateindex = 1>
<cfset i = startday>
<cfloop  condition="i lte days">
	<cfset MonthArray[i] = dateindex>
	<cfset dateindex = dateindex + 1>
	<cfset i = i + 1>
</cfloop>
 
<table border="1" cellpadding="2" width="100%"  height="100%">
 
<tr>
	<td colspan="8" height="8">
		<table width="100%" height="8">
		<cfif location_id gt 0>
		<tr><cfoutput>
				<td align="left"><a href="staff.cfm?month=#prevmonth#&year=#prevyear#&change_staff=#change_staff#&location_id=#location_id#"><< Previous</a></td>
				<td><a href="staff.cfm?location_id=#location_id#">Today</a></td>
				<td align="right"><a href="staff.cfm?month=#nextmonth#&year=#nextyear#&change_staff=#change_staff#&location_id=#location_id#">Next >></a></td>
			</cfoutput>
			</tr><br><cfelse>
			<tr><cfoutput>
				<td align="left"><a href="staff.cfm?month=#prevmonth#&year=#prevyear#&change_staff=#change_staff#"><< Previous</a></td>
				<td><a href="staff.cfm">Today</a></td>
				<td align="right"><a href="staff.cfm?month=#nextmonth#&year=#nextyear#&change_staff=#change_staff#">Next >></a></td>
			</cfoutput>
			</tr><br>
			</cfif>
		</table>
	</td>
</tr>
 
<tr>
	<td colspan="8" align="center" height="7" >
		<cfoutput><strong>#MonthAsString(currmonth)# #curryear# --- #today#</strong></cfoutput>
	</td>
</tr>
 
<tr>
	<td width="14%" class="heading" align="center" height="8">Friday</td>
	<td width="14%" class="heading" align="center" height="8">Saturday</td>
	<td width="14%" class="heading" align="center" height="8">Sunday</td>
	<td width="14%" class="heading" align="center" height="8">Monday</td>
	<td width="14%" class="heading" align="center" height="8">Tuesday</td>
	<td width="14%" class="heading" align="center" height="8">Wednesday</td>
	<td width="14%" class="heading" align="center" height="8">Thursday</td>
	<td width="14%" class="heading" align="center" height="8">Friday</td>	
</tr>
 
<tr>
<cfif MonthArray[36] is 0>
	<cfset endpoint = 35>
<cfelse>
	<cfset endpoint = 42>
</cfif>
 
<cfloop index="pos" from="1" to="#endpoint#">
	<cfif MonthArray[pos] gt 0>
		<cfset cal_date = CreateDate(curryear, currmonth, #MonthArray[pos]#)>
	</cfif>
	<td align="left" valign="top" class="day" 
		<cfif thismonth is currmonth and thisyear is curryear and #MonthArray[pos]# is currday>
			bgcolor="#D0C37E"
		<cfelseif MonthArray[pos] is 0 >
			bgcolor="#CCCCCC" 
		</cfif>>
		
		<cfif MonthArray[pos] gt 0>
			<cfoutput>
				<a href="javascript:void()" onclick="javascript:dutyupdate('dsp_edit_day.cfm?day=#MonthArray[pos]#&year=#curryear#&month=#currmonth#&location_id=#location_id#');">
				#MonthArray[pos]#
				</a> <br>
			</cfoutput>
 			<cfset cal_date = CreateDate(curryear, currmonth, #MonthArray[pos]#)>		 
			
		<cfelse>&nbsp;
		</cfif>
	</td>
	<cfif pos mod 7 eq 0>
		<cfset pos = pos + 1>
		<td align="left" valign="top" class="day" 
		<cfif thismonth is currmonth and thisyear is curryear and #MonthArray[pos]# is currday>
			bgcolor="#D0C37E"
		<cfelseif MonthArray[pos] is 0>
			bgcolor="#CCCCCC" 
		</cfif>>
		
		<cfif MonthArray[pos] gt 0>
			<cfoutput>
			<a href="javascript:void()" onclick=
				"javascript:dutyupdate('dsp_edit_day.cfm?day=#MonthArray[pos]#&year=#curryear#&month=#currmonth#&location_id=#location_id#');">
			#MonthArray[pos]#
			</a> <br>
			</cfoutput>
 			<cfset cal_date = CreateDate(curryear, currmonth, #MonthArray[pos]#)>		 
		<cfelse>&nbsp;
		</cfif>
		</td>
		<cfset pos = pos - 1>
		</tr><tr>
		</tr></cfif>
 
</cfloop>
 
</table>
 
Keywords: The element at position 43 of dimensi…
 
Loading Advertisement...
 
[+][-]08.11.2008 at 06:34AM PDT, ID: 22204157

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Cold Fusion Markup Language, ColdFusion Application Server
Tags: Coldfusion
Sign Up Now!
Solution Provided By: Plucka
Participating Experts: 1
Solution Grade: A
 
 
[+][-]08.11.2008 at 06:44AM PDT, ID: 22204259

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628