[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

01/10/2008 at 12:09PM PST, ID: 23073740
[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!

9.2

Dynamically populate multidimensional array

Asked by marcus72 in Active Server Pages (ASP), Miscellaneous Programming, Web Languages/Standards

Tags: array, multidimensional, populate, create, dynamically

Hi, I am creating a form that populates the form input boxes based on the user selection from a dropdown box shown in the form code below.
this creates a for wher the user can select an hour and minute
dropdown to create an appointment for each service area (svar) they would like their order fulfilled.  As a result it is possible for the form to have anywhere from 1 to 165 area to select appointments that apply to them.  I would like to take their selections and insert them into my database.  
apptdate, area1, area2, area3, area4, area5
so the apptdate is easy, but if the user creates a form that choose areas 1,3,5
my request.form("lights_hour") and request.form("lights_minute") with the following times:
13:30, 14:31, 15:32
gives me a values of
13, 14, 15, 30, 31, 32
which is the three hour values as one value separated with a comma and the three minute values separated by a comm.  What I want to do at this point is create a two dimensional array so that I can combine the appropriate hour with the appropriate minute and turn 13, 14, 15, 30, 31, 32 into 13:30, 14:31, 15:32 so that I can write my insert statement with those values.  What I have so far goes something like this:
lights_hour = request.Form("lights_hour")
lights_minute = request.Form("lights_minute")
svar_num = request.form("svar_num")

hourArray = split(lights_hour,",")
minuteArray = split(lights_minute,",")
svar_numArray = split(svar_num,",")
dim timeArray(2,uBound(svar_numArray))
for i=0 to uBound(svar_numArray)
timeArray(0,i) = hourArray(i)
timeArray(1,i) = minuteArray(i)
next

I am getting this error message:
Expected integer constant
/includes/service/fsoslights.asp, line 65
dim timeArray(2,uBound(svar_numArray))
--------------------^

I really hope this makes sense and someone is able to help me or give me another suggestion on how to tackle this problem  thanks in advance.  Marcus.


'form code
<form method="post" action="fsoslights.asp">
<div align="center">
<table cellpadding="0" cellspacing="0" border="1" bordercolor="#CCCCCC">
<tr><td>
<select name="selLights">
<option value="all" selected="selected">All</option>
<option value="tn">TN</option>
<option value="gw">GW</option>
<option value="416tn">416 TN</option>
<option value="416gw">416 GW</option>
<option value="519tn">519 TN</option>
<option value="519gw">519 GW</option>
<option value="613tn">613 TN</option>
<option value="613gw">613 GW</option>
<option value="705tn">705 TN</option>
<option value="705gw">705 GW</option>
<option value="905tn">905 TN</option>
<option value="905gw">905 GW</option>
</select>
</td>
<td colspan="12">
<input type="submit" value="submit">
<%
i = 1
set lightsRS = objADOconn.execute(strLights)
do until lightsRS.eof
%>
<tr>
<td>
<%=(lightsRS("SVAR")&"<br>")%>
</td>
<td>
<select name='lights_hour'>
<option value="HH">HH</option>
<% for counter = 0 to 24 %>
<option value="<%=counter%>" <% if counter = hour(LightsDate) then %> selected <% end if %>><%=counter%></option>
<%next%>
</select>
<select name='lights_minute'>
<option value="MI">MI</option>
<% for counter = 0 to 60 %>
<option value="<%=counter%>" <% if counter = minute(LightsDate) then %> selected <% end if %>><%=counter%></option>
<%next%>
</select>
</td>
</tr>
<%
i = i + 1
<input type="hidden" value="<%=i%>" name="svar_num">
lightsRS.movenext
loop
%>
[+][-]01/10/08 12:16 PM, ID: 20630682

View this solution now by starting your 30-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: Active Server Pages (ASP), Miscellaneous Programming, Web Languages/Standards
Tags: array, multidimensional, populate, create, dynamically
Sign Up Now!
Solution Provided By: SquareHead
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20091111-EE-VQP-91 / EE_QW_2_20070628