472,326 Members | 2,275 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,326 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
2 1920
jo*******@gmail.com wrote:
...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...
Joe,

You will probably get a better response if you clean up your post to include
only the relevant portions of your problem. Nobody wants to wade through a
bunch of markup searching for those clues. It is in your interest to show us
the smallest example that illustrates your problem.

That said, I see a bunch of <!--webbot--tags, which suggest Frontpage.
Consider yourself lucky if you can find someone willing to touch THAT.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Oct 28 '06 #2

<jo*******@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
So heres the deal...
<snip to the point>
Users enter data, gets dropped into a csv in our
_private folder.
<snip to the point>
the owner wants this list to be sortable by the last name of the
agent....
This is where I have the problem.
<snip to the point>
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.
<snip irrelevant frontpage mess>
>
++++++++++++++++++++++++++++++++++++
this is the admin page i am trying to create
+++++++++++++++++++++++++++++++++++++
<%
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)
for table = 0 to num_imported -1
%>

<td>
<%= split_text(count) %></td>
<%
count=count+1
next
%>
</tr>
<tr>
<%
'Reset the counter
count=0
for tablea = 0 to (total_num_imported/ (num_imported)-1)
%>
<%
for table = 0 to num_imported -1
%>

<td>

<%= total_split_text(count)%>
</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
Can you provide the structure of your csv file? Eg. Title, Firstname,
Surname etc...
--
Mike Brind
Oct 28 '06 #3

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...
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: ...
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...
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...
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...
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...
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...
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...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

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.