I have part of a keyword search function that is acting supernatural - I have a bubble-sort function that sorts the content of an array, then returns an array containing the item numbers of the original array, arranged in order according to their content. Code:
What I need to do is sort an dimention array by the name field and the best way I can think of to do this is by a bubble sort. However, I'm running into a problem with the bubble sort and I'm sure I'm just missing something simple.Here is the code I have Code:
Dim objAllBrands, objBubbleArray, a, i
For i = 1 to objAllBrands.count For a = 1 to objAllBrands.count If objAllBrands.item(a).Name < objAllBrands.item(i).Name then objBubbleArray = objAllBrands.item(i) objAllBrands.item(i) = objAllBrands.item(a) objAllBrands.item(a) = objBubbleArray End if Next Next
It doesn't like this line objBubbleArray = objAllBrands.item(i) and I'm sure there are other problems. Can anyone give me a hand with this?
I have a group of variable i wish to get out of the url
like www.domain.com?id1=30&id2=50&id4=99
now i can get the values no problem using request.querystring.
my problem is i need to use the more than once, and I want to put them through a loop, to make different lines of code, if i use an array it only picks up the info once then i am pooped.
I have tried id&(i) and using a next loop looop, but that only picks up th i as the number not the variable.
I have a multidimensional array with 5 keys. I need to perform a alpha sort on the 3rd key. Does anyone have an example on how to do this?Here is an example of what my array consists of:
mArray(i,0) = '2007-05-02" mArray(i,1) = "6:00pm" mArray(i,2) = "TEXT TEXT TEXT" <------------------ NEED TO DO ALPHA SORT ON THIS KEY ----------------<< mArray(i,3) = 6 mArray(i,4) = 4
I have an array which has days of the month stored in it. For example at one time it might have the values
1,2,3,6,7,8,9
at another time it might have the value
4,5,12,14,19,25
These are days of the month that have been selected and read into an array. What i would like to do is to write them out and put a "X" where the days were selected Code:
i m getting these value from a query n stored it in an array:
FY2005 P1 (8/1/2005 - 8/31/2005), FY2005 P2 (9/1/2005 - 9/31/2005) and so on. i need to use eg 8/1/2005 as startdate and 8/31/2005 as enddate similarly 9/1/2005 as startdate and ,9/31/2005 as enddate. and so on
we can split FY2005 P1 (8/1/2005 - 8/31/2005), FY2005 P2 (9/1/2005 - 9/31/2005) by using split func in vbscript. But how can we use its subparts.i mean 8/1/2005 etc ...
some ready-made code that will loop through the values in an array and sort them in ascending or descending order? I'm about to start building some new functionality that will need to sort the values in an array and then present them in ascending order. My initial thoughts are to loop through the initial array, find the lowest value and then load that value (and all associated values) into a new array.
I first retrieve the values stored in a session variable (where I have stored an array). Then I assign the session variable to a local array called "myarray".
Assume that "myarray" now contains 5 records. What would the code look like if I want to create a loop that transfers the 5 values from "myarray" into a select box/dropdown list?
I have 24 checkboxes all with the same naming convention, each box has a value ranging from 1 to 23, what I need to do is fill in the gaps with a 0 value where the user doesn't select a value.
So lets say that the user selects:
1,2,3,4,5,6,7,15,18,19,20
what I want to do is use the split function on the next page to convert into an array but then I want to redim the array and fill in the missing values, so I would end up with:
I know that cookies can store an array of values, which can be accessed like this:
tempid = Request("cookiename")(i)
Is it possible to use session variables in the same way? Store a array of values in the same session variable and access them on another page by indexing?
I've looked around alot and I've not found anything suggesting that this is possible.
Right now I'm using a single set of cookies to store info on a series of purchaces of the same type of item. I'm hoping to use session variables to replace the cookies.
Does anyone know for certain if this is not possible?
I was wondering if you could help me with the following problem. I have 2 listboxes in my webpage, 1 has cities, and the other lists the streets of the city from the first listbox.
When I click on a city, I want the 2nd listbox to populate with all streets in the city. The city and streets are saved in a database, so when the user selects the city, I will run a query on the database and populate the 2nd listbox with all streets.
How can I do this with normal ASP? I know how to do this with ASP.NET, but don't know how to activate this with normal ASP?
how to create an array of checkboxes that were selected from a form on one page and pass them into hidden fields in a form on the next page? I have this massive project I've been working on and am having trouble with this.
I am trying to filter a table of users to select only those records whose roleID matches a value in an array. There could be any number of IDs held in the array from one to a few hundred. The array is generated by splitting a comma delimited memo field from a second table in an Access DB. I can split the memo field OK, I can response.write its values, but what I now want to do is add a value from another table to my reponse write loop. Code:
I have this dynamic array(shown below) that I need to match to values (1 - 10) that I am returning from the database via DSN connection object.
The values I need to match are on the same page (in their own table) but I am not sure how to match up the array indexes to these values. I want to be able to display the array result as part of or nested in another table. Code:
if i have a vbscript function on a certain form and I assigned some values on an array variable on that function, is there a way for me to retrieve the values of that array on another asp page once i submitted the form?
I need a routine to check for a number called CPF (just like Social Security Number in USA). I already have a validation routine for that number, but I still need to check if it exists on the institution databank to avoid frauds on my system.
The idea is to build a "new user register page" and with a CPF field. So, when the person enter his CPF, the ASP page would check on the institution databank and validate or not the number. The url for the public query is the following, remember to replace "hxxp" with "http" to open the page correctly: Code:
I am still playing with ASP and was wondering how to do this (it seemed simple). What I want is to have a hyperlink that when it's clicked on, will run a sub routine, instead of opening a web page... Right now I have;
Sub CreateLinks() Response.Write "<br><br>" Response.Write "<a href='OpenAllOrders()'>1. All Orders</a><br>" Response.Write "<a href='OpenCustOrders()'>2. Customer Orders</a><br>" Response.Write "<a href='OpenInvoices.asp'>3. Open Invoices</a><br>" End Sub
Sub OpenAllOrders() Response.Redirect "OpenOrders.asp?Customer=0" End Sub
Sub OpenCustOrders() Response.Redirect "OpenOrders.asp?Customer=1" End Sub
The issue, is that clicking on the link, tries to open a web page file of 'openallorders()', instead of running the sub routine. Obviously I am missing something simple... Can anyone point me in the correct direction (think it has something to do with href... maybe it should be hsub or something).
I have an error handling routine that emails me the Err.Source, Err.Nbr, and Err.Description in the event of an error. How can I include the line number of the error as well and the filename?
I have a script that I want to display the returned list numerically in. The database is deciding how to order the list, and is being displayed pretty loosely. Is there anyway I can sort the returned list numerically here? Code:
I have a database table, that I need to sort by PART of the contents of a field (named rFieldName in the table):sample contents of this field are:Code:
qid_5_question_1 qid_12_question_5_0_1 qid_12_question_5_0_2 qid_12_question_5_1_1 qid_12_question_5_1_2 qid_12_question_5_2_1 qid_12_question_5_2_2 qid_12_question_5_3_1 qid_12_question_5_3_2 qid_6_question_2I need to sort his field by the value that appears AFTER the 3rd underscore, and if applicable BEFORE the 4th underscore Is this possible - can you help please - I have no idea where to start on this as I've never had to try to do something like this before.
I have a JS/ASP application that sorts a SQL populated table. This works great, and sorts the data fine, apart from my currency columns. It wants to read the data as text as far as i can gather. Ths data in ASP looks like this - <% =formatcurrency(RS("income"),2)%> I have tried changing this to a number (formatnumber) and hard coding a £ sign, yet it still wants to read the data as text, rather than numerical? How can i get my JS function to read currency or if not, eliminate the forehand figures. I need the data to appear as a currency, yet be sorted as a number (rather than taking the 2st digit)if this is a common problem (sorting currency) and there was a universal solution around this
I've lurked on here for awhile but I've come upon something I'm having trouble with. I have a database table of movie titles and I want to sort by the column, but ignore the articles in the title, "a", "an" or "the"... "The Lion King" would be under L... "A Bronx Tale" would be listed under "B", etc. Does anyone have a function that does this or know of another method? Or am I forced to enter them as "Lion King, The", for example?