473,549 Members | 2,669 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="vbscr ipt">
sub referrals_oncha nge()
DIM intCounter
for intCounter = 1 to 5
if CInt(document.a ll.item("referr als").value) >= intCounter
then

document.all.it em("referral_"& intCounter).sty le.display="blo ck"
else
document.all.it em("referral_" &
intCounter).sty le.display="non e"
end if
next
end sub
</script>
</head>

<body>
<table border="1" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#1 11111"
id="AutoNumber1 " bgcolor="#C0C0C 0">
<tr>
<td width="100%" colspan="3">
<img src="../images/1newbanner.jpg" width="513" height="57"><fo rm
method="POST" name="FrontPage _Form1" action="--WEBBOT-SELF--"
target="_self">
<!--webbot bot="SaveResult s" u-file="../_private/game.csv"
s-format="TEXT/CSV" s-label-fields="TRUE" b-reverse-chronology="FAL SE"
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="SaveResult s" endspan
i-checksum="43374 " --><p>
<font face="Arial" size="2" color="#000066" >Welcome
<!--webbot bot="HTMLMarkup " startspan --><span
id="lblCurrentU serName"></span><!--webbot bot="HTMLMarkup " endspan
--></font></p>
<hr>
<p>
<font face="Arial"><f ont 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="agentFnam e" 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="agentLnam e" size="20" maxlength="20"> </font></font></p>
<hr>
<p>
<font face="Arial"><f ont 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="agentNumb er"
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"><f ont size="2" color="#000066" >What is the
agents e-mail address:<br>
</font><font color="#000066" >
<input type="text" name="agentEmai l" size="40"></font></font></p>
<p>
<font face="Arial"><f ont 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"><i nput type="submit"
value="Submit" name="B1"><inpu t 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="vbscr ipt">

dim txtUserName
txtUserName = "<% = (Session("UserN ame")) %>"

Sub window_onload()
window.parent.d ocument.all.ite m("uname").valu e = txtUserName
window.parent.d ocument.all.ite m("lblCurrentUs erName").InnerT ext =
txtUserName
end sub

</script>

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

<b><font color="#000066" face="Arial">Ma rketing Contest Results
<%
csv_to_read="../_private/game.csv"
set fso = createobject("s cripting.filesy stemobject")
set act = fso.opentextfil e(server.mappat h(csv_to_read))
imported_text = act.readline
imported_text = replace(importe d_text,chr(13), ",")
imported_text = replace(importe d_text,chr(34), "")
split_text=spli t(imported_text ,",")
num_imported=ub ound(split_text )+1
total_imported_ text = act.readall
total_imported_ text = replace(total_i mported_text,ch r(13),",")
total_imported_ text = replace(total_i mported_text,ch r(34),"")
total_split_tex t=split(total_i mported_text,", ")
total_num_impor ted=ubound(tota l_split_text)
%>
</font>
</b>
<table width="100%"bor der="1" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#1 11111" >
<tr>

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

<td width="<% response.write 100/(num_imported) 'make the cell widths
even %>%"bgcolor="#C 0C0C0">
<font face="Arial" size="1" color="#000066" >
<b><%= split_text(coun t) %></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_impo rted/ (num_imported)-1)
%>
<%
for table = 0 to num_imported -1
%>

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

<font face="Arial" size="1" color="#000066" >
<%= total_split_tex t(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 2058
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*******@gmai l.comwrote in message
news:11******** **************@ m73g2000cwd.goo glegroups.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("s cripting.filesy stemobject")
set act = fso.opentextfil e(server.mappat h(csv_to_read))
imported_text = act.readline
imported_text = replace(importe d_text,chr(13), ",")
imported_text = replace(importe d_text,chr(34), "")
split_text=spli t(imported_text ,",")
num_imported=ub ound(split_text )+1
total_imported_ text = act.readall
total_imported_ text = replace(total_i mported_text,ch r(13),",")
total_imported_ text = replace(total_i mported_text,ch r(34),"")
total_split_tex t=split(total_i mported_text,", ")
total_num_impor ted=ubound(tota l_split_text)
for table = 0 to num_imported -1
%>

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

<td>

<%= total_split_tex t(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
10928
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
7278
by: Mark Kamoski | last post by:
Hi-- Please help. I need a code sample for bubble sort. Thank you. --Mark
4
3658
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) Dim i, j, x As Integer x = roundarray.GetUpperBound(0) Dim tempname, tempnumber As String For i = 0 To x - 1 For j = i + 1 To x
0
4414
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 "word", or "eelttr" for "letter". Build an array of all the keys, and sort it using a bubble sort. I have to write a modified version of bubble sort that...
1
5641
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 integers. How do i get a bubble sort to put names in alphabetical order?
9
19664
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> #define MAXWORD 101 void swap(int *i, int *j); int main(void) { int sort;
12
8626
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 multiple values. I need to make a bubble sort that reaches into an array called Tree which has in each storage location a class called Christmas Tree...
14
8019
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 program then should sort the names alphabetically by last name and display a list of all the students names and grades in alphabetical order. I have...
7
7125
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 this array. please help me. my scenario: assume that we have a big 2d char array for example students for 20 persons an 30 character for each...
0
7457
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7723
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
6051
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5375
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5092
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3504
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3487
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1949
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1063
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.