bubble sort!?

Discussion in 'ASP General' started by joesindel@gmail.com, Oct 27, 2006.

  1. Guest

    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.display="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("lblCurrentUserName").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, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Scott Lyons

    Two-Dimensional Bubble Sort

    Scott Lyons, May 3, 2004, in forum: C++
    Replies:
    1
    Views:
    388
    Scott Lyons
    May 3, 2004
  2. Protoman
    Replies:
    8
    Views:
    515
    Richard Herring
    Apr 5, 2006
  3. bubble sort

    , Aug 28, 2006, in forum: C++
    Replies:
    3
    Views:
    516
  4. Selection sort and bubble sort

    , Oct 16, 2007, in forum: C Programming
    Replies:
    22
    Views:
    1,800
    user923005
    Oct 19, 2007
  5. mlimber
    Replies:
    0
    Views:
    838
    mlimber
    Aug 5, 2008
Loading...

Share This Page