473,395 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

bubble sort!?

So heres the deal...
I work for a company in which numbers are dropping. The owners created
a game where calling potential clients racks up points for crap like
basketball ticekts and such. The owners called upon me to develop a
system where users could enter information to list user name, data
stamp it, and then add form data such as the person they called and if
it was a cold call or not. All that was pretty easy. Oh, by the by, I
had never programmed anything prior to this. I was strictly html. So I
made the game... Users enter data, gets dropped into a csv in our
_private folder. Then I made it so that the data can be read in html
format, simple fso... Well not for me, but I got it to work... So now,
the owner wants this list to be sortable by the last name of the
agent....
This is where I have the problem.
You see, I have a boss, a programmer. He is in Canada where as I am in
California. He is far to busy to assist me, and his teaching methods
consist of telling me one key word, and leaving me to google the hell
out of it. So his key work was bubble sort.
Now I have been playing with this for,,, well over a week now (a few
days past deadline) and I cannot get it to work properly.
I can get bubble sort to work on an array of pre-defined data...
My problem( which I have taken forever to get to, sorry) is that I need
to get it to look at the whole csv, find out where the eof is, then
read up from there...
I have no idea how to do this, and no jedi like mentor to ask
assistance. I ask for help and either get harped at or a "lol"... Its
getting old...

Here is the code for the game
++++++++++++++++++++++++++++++++++
<script language="vbscript">
sub referrals_onchange()
DIM intCounter
for intCounter = 1 to 5
if CInt(document.all.item("referrals").value) >= intCounter
then

document.all.item("referral_"&intCounter).style.di splay="block"
else
document.all.item("referral_"&
intCounter).style.display="none"
end if
next
end sub
</script>
</head>

<body>
<table border="1" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#111111"
id="AutoNumber1" bgcolor="#C0C0C0">
<tr>
<td width="100%" colspan="3">
<img src="../images/1newbanner.jpg" width="513" height="57"><form
method="POST" name="FrontPage_Form1" action="--WEBBOT-SELF--"
target="_self">
<!--webbot bot="SaveResults" u-file="../_private/game.csv"
s-format="TEXT/CSV" s-label-fields="TRUE" b-reverse-chronology="FALSE"
s-date-format="%d-%m-%Y" s-time-format="%I:%M:%S %p"
s-builtin-fields="Date Time" startspan --><input TYPE="hidden"
NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults" endspan
i-checksum="43374" --><p>
<font face="Arial" size="2" color="#000066">Welcome
<!--webbot bot="HTMLMarkup" startspan --><span
id="lblCurrentUserName"></span><!--webbot bot="HTMLMarkup" endspan
--></font></p>
<hr>
<p>
<font face="Arial"><font size="2" color="#000066">Please enter
the name of the agent with whom you made contact:<br>
First Name: </font><font color="#000066">
<!--webbot bot="Validation" s-data-type="String"
b-allow-letters="TRUE" i-maximum-length="15" --><input type="text"
name="agentFname" size="20" maxlength="15"></font><font size="2"
color="#000066"><br>
Last Name: </font><font color="#000066">
<!--webbot bot="Validation" s-data-type="String"
b-allow-letters="TRUE" i-maximum-length="20" --><input type="text"
name="agentLname" size="20" maxlength="20"></font></font></p>
<hr>
<p>
<font face="Arial"><font size="2" color="#000066">Please enter
the agents phone number:<br>
</font><font color="#000066">
<!--webbot bot="Validation" s-data-type="Number"
s-number-separators="x." b-value-required="TRUE" i-minimum-length="10"
i-maximum-length="10" --><input type="text" name="agentNumber"
size="20" maxlength="10"></font><font size="2" color="#000066">
( </font><font size="1" color="#FF0000">must have 10 digits
</font><font size="2" color="#000066">
)</font></font></p>
<p>
<font face="Arial"><font size="2" color="#000066">What is the
agents e-mail address:<br>
</font><font color="#000066">
<input type="text" name="agentEmail" size="40"></font></font></p>
<p>
<font face="Arial"><font size="2" color="#000066">Please select a
category which best describes the agent with whom you made
contact:<br>
Active Agent </font><font color="#000066"<input type="radio"
value="active" checked name="agentType"></font><font size="2"
color="#000066">
Inactive Agent </font><font color="#000066"<input type="radio"
name="agentType" value="inactive"></font><font size="2"
color="#000066">Cold
Call</font><font color="#000066"><input type="radio"
name="agentType" value="cold"></font></font></p>
<p>
<font face="Arial" color="#000066" size="2">How many referrals
this agent
give you?<br>
<select size="1" name="referrals">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select></font></p>
<p>
&nbsp;</p>
<p>
<input type="text" name="referral_1" size="20"
style="display:none"></p>
<p>
<input type="text" name="referral_2" size="20"
style="display:none"></p>
<p>
<input type="text" name="referral_3" size="20"
style="display:none"></p>
<p>
<input type="text" name="referral_4" size="20"
style="display:none"></p>
<p>
<input type="text" name="referral_5" size="20"
style="display:none"></p>
<hr>
<p>
<font color="#000066" face="Arial"><input type="submit"
value="Submit" name="B1"><input type="reset" value="Reset"
name="B2"></font></p>
<input type="hidden" name="uname" value="hidden">
</form>
</td>
</tr>
</table>

<iframe src="date_user.asp" width="80%" height=100 frameborder=0
scrolling=no name="date_time" styke="display: none">

</iframe>

++++++++++++++++++++++++++++++++++++++++++
this is the code for data_user.asp
++++++++++++++++++++++++++++++++++++++++++
<script language="vbscript">

dim txtUserName
txtUserName = "<% = (Session("UserName")) %>"

Sub window_onload()
window.parent.document.all.item("uname").value = txtUserName
window.parent.document.all.item("lblCurrentUserNam e").InnerText =
txtUserName
end sub

</script>

++++++++++++++++++++++++++++++++++++
this is the admin page i am trying to create
+++++++++++++++++++++++++++++++++++++

<b><font color="#000066" face="Arial">Marketing Contest Results
<%
csv_to_read="../_private/game.csv"
set fso = createobject("scripting.filesystemobject")
set act = fso.opentextfile(server.mappath(csv_to_read))
imported_text = act.readline
imported_text = replace(imported_text,chr(13),",")
imported_text = replace(imported_text,chr(34),"")
split_text=split(imported_text,",")
num_imported=ubound(split_text)+1
total_imported_text = act.readall
total_imported_text = replace(total_imported_text,chr(13),",")
total_imported_text = replace(total_imported_text,chr(34),"")
total_split_text=split(total_imported_text,",")
total_num_imported=ubound(total_split_text)
%>
</font>
</b>
<table width="100%"border="1" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#111111" >
<tr>

<%
for table = 0 to num_imported -1
%>

<td width="<% response.write 100/(num_imported) 'make the cell widths
even %>%"bgcolor="#C0C0C0">
<font face="Arial" size="1" color="#000066">
<b><%= split_text(count) %></b>
&nbsp;</td>
<%
count=count+1
next
%>
</tr>
<tr>
<font face="Arial" size="1" color="#000066">
<%
'Reset the counter
count=0
for tablea = 0 to (total_num_imported/ (num_imported)-1)
%>
<%
for table = 0 to num_imported -1
%>

<td width="<%= 100/(num_imported) %>%">

<font face="Arial" size="1" color="#000066">
<%= total_split_text(count)
%>

</font>

&nbsp;</td>
<%
count=count+1
next ' end of the observation
%>
</tr>
<% next 'end of the csv %>
</table>
+++++++++++++++++++++++++++++++++++++++++++++++++
so there it is...
I no Im lame...
I have no idea how to do any of this, but do not remember it being in
my job description either.
Either way, I have to learn or Im gone...
All advice will be appreciated.
Thanks very much,
- joe

Oct 27 '06 #1
0 958

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Gram | last post by:
Hello, Can anyone help out with a bubble sort for strings using ASP? I have a text file of words id like to sort and count. Thanks in advance for any help. Gram.
34
by: Mark Kamoski | last post by:
Hi-- Please help. I need a code sample for bubble sort. Thank you. --Mark
4
by: Chris | last post by:
I have a bubble sort for a 2-dimensional array that sorts a string,number pair based on the number. The code for the sort is as follows: Private Sub SortArray(ByRef roundarray(,) As String)...
0
by: Slowjam | last post by:
How do I correct the program below to search all the anagrams in a given file. First, for each word, build another word (its key) with all its letters sorted. For instance, build "dorw" for...
1
by: guest | last post by:
I am doing a program for Intro to Computer Programming where we take an array of strings and we must sort them alphabetically. we are supposed to use a bubble sort, but i know the code if meant for...
9
by: mosullivan | last post by:
I can't figure out how to print after every pass through the bubble sort. I'm supposed to display the sort after every pass through the loop. Below is what I have so far. #include <stdio.h>...
12
by: midknight5 | last post by:
Hello everyone, I am familiar with a normal bubble sort when dealing with an array of number but I am unsure as how to implement a sort when I have an array that is filled with classes which hold...
14
by: xtheendx | last post by:
I am writing a gradbook type program. It first allows the user to enter the number of students they want to enter. then allows them to enter the first name, last name, and grade of each student. The...
7
by: mahdiahmadirad | last post by:
Hi dears! I wrote a simple bubble sort algorithm. it works properly when we compare full arrays but i want to sort a 2d array according to a specific part of array. it has some problem to swapping...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.