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
can I do it? because when I tried to do ==== dim array01(2,2) array01(0,0) = "test" array01(0,1) = 5 ==== it returns an error: ================ Microsoft VBScript runtime (0x800A000D) Type mismatch ================
How do I tell ASP that the specific variable is INTEGER, or CHAR or STRING? and How do I manage my problem?
I am trying to sort a multi dimensional array but am getting an error. Can someone please help me out. Here is a sample of the array (it is created dynamically from the db): Code:
i have a sorted array of 43 columns. dynamically altered the array and added a new row to the existing array. i need to sort the array based on 2nd column. how to sort a multidimensional array?
I have a multidimensional array that is actually 1 dimension (it comes from a recordset.getrows that returns 1 column). My goal is to put every single line of the recordset in a textfile. currently, here is my code Code:
for i = 0 to UBound(Res,2) fileContent = fileContent & res(0,i)) Next createTxtFile(path,fileContent)
I have 5000 lines and it takes about 10 minutes. I was thinking of doing a Array.Join but I don't think that works with multidimentional array. Also thinking of converting my useless multidimentional array into a sing dimensional array but how?
I am extremely stuck. I am trying to create a simple shopping cart yet keep running into the same type mismatch error everytime, no matter what I do. I have read countless articles about this, even posts in this forum, I've followed their code exactly and still I get the same error.
In the global.asa i am trying to create a multidimensional array with just two columns, product id and quantity, keeping it simple for now. global.asa SUB Session_OnStart CONST CART_COLUMNS = 1 Dim cartArray() ReDim cartArray( CART_COLUMNS, 1 ) cartMaxUsed = -1 Session("cartArray") = cartArray Session("cartMaxUsed") = cartMaxUsed
END SUB
Now in my subsequent asp pages I have created functions to add to the array, following code exactly from articles, posts, etc., but everytime I would run them, it would fail on a type mismatch error when I tried to get the UBound of the array.
Error Type: Microsoft VBScript runtime (0x800A000D) Type mismatch: 'UBound' /store/add.asp, line 10
So just for testing I simplified it as much as possible and it would still fail on the same line of code. Here is the code for add.asp
Dim cartArray Dim cartMaxUsed cartArray = Session("cartArray") cartMaxUsed = Session("cartMaxUsed") dim num num= UBound(cartArray, 2) response.write num 'for testing purposes response.end 'only
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 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:
I have a text file that I'm reading into a SQL table, from there I need to run various scripts on it to clean it up. One being, there is field that comes in as:
ie: JNJG12345 MAN5678 XY4656565
I need to split this by Alpha characters, then Numeric characters and be able to input them into seperate fields as such:
JNJG 12345 MAN 5678 XY 4656565
I have managed to locate a script that Memnoch came up with: http://forums.aspfree.com/t24666/s....ht=split+string that managed to get me where I am now.
How do I get the loop to stop once it finds the first occurence of a number? Below is the code I am using.
what i want to do is to put 2 fields in my table , username and password
what iwant to do is to create a page that ask you to unter your username only ,and when u click submit the other page will add new record for the username u enter and will input a randomly alpha(letters and numbers) to yr password field , so how can do this random thing throw the asp"!?!
I am coding an ASP script, which currently requires a 5-dimension array, i.e. array(a,b,c,d,e)
I remember reading somewhere, a long time ago, that there is a limit to the number of dimensions in ASP. That was a long time ago, and I don't remember.
I'm just confused because I'm obviously calling the code wrong but every tutorial I find makes it seem like I'm referencing the multidimensional arrays correctly so I don't knwo what I'm doing wrong. Code:
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?
And one clicks on the form, and a SQL statement is executed. However, when I create the SQL statement,
INSERT INTO table1 (FormId,AdvantageId,SortOrder) VALUES (<call from form ID>,<advantages>,<advantsort>)
Then it loops to allow the next phrase to be entered. The statement also takes the value from every other sort order value including that ones that are in different lines. Which in result, gives me an error, saying the insert columns exceed that of the available columns in the table.
I would like sort table. The table is createobject method (open a function and use SAP connection) and the table not use recordset. is it possible sort table for example or how can i sort table columns.
I'm trying to sort the fso. The file names are named june2004, july2004, august2004, ect... I need to sort them in chronological order starting with the latest one first.
The files were recently created so sorting them by the modified or created date will not work. The only other way is to them by the name of the file. I tried converting name of the file into a date using CDate (formated the file names as July 2004, August 2004, ect...) but it did not work. Code:
region = array("a", "b", "c", "d") I am sorting in desc order that is d, c, b, a, it works fine. Is there a way to sort them as d,c,a,b? How do I do? thanks. Code:select* from mytable Order by region desc
SELECT * WHERE Titlename LIKE '%Crimson%' AND Titlename LIKE '%Skies%' order BY Titlename
This gives me all results containing both "Crimson" and "Skies". But I want a result that contains exactly "Crimson Skies" to appear first in addition to the blended results.
When I try to sort rows of records in asp with sql I cant get them coming out right. The column I'm trying to sort has record values such as 63, 254, 98, 7 but when I try to sort them ascending I get 254, 63, 7, 98 but I want 7, 63, 98, 254. Please help because its been annoying me for ages.
I have an Access "date/time" column and I am trying to use SQL to select by month. I thought the code below would work (to query for records in april for example) but I am still getting all the records regardless of when the date is.
SELECT * FROM comm WHERE comm_requested_date = month(4)
Basically, I have a drop menu with the months and I want to query the DB for all records for a particular month.
Is it possible to do the following in asp. I have a flash game which saves the name time and email of the users race. Is it possible to sort through my database (ms access) and then display the quikest 10 in flash as high scores? This is my load.asp where my database results are at the mo.
I have Table Named "League_Table" in MS Access and data Stored in Table as follow Tm P W D L Pt ABL 2 0 0 2 0 HBL 2 1 1 0 4 KRL 2 2 0 0 6 PIA 1 1 0 0 3 ..................... ..................... ..................... ..................... ..................... .....................
There are 16 Teams in League. Now I want to sort Records on the basis of Points, assign Rank to Teams and display on Web page using ASP.