Sort Filenames With Download Links By Date - Multidimensional Array ??
i use this script to generate download links from directories which are first passed to an script to record the number a link is clicked.
the function is calle with a path like:
ListFolderContents(Server.MapPath("/dir1"))
my question now is: can i write this to an multidimensional array (or object oriented?) - and then sort it by date ?? if so how ? Code:
View Replies
ADVERTISEMENT
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
View Replies
View Related
I actually work with multidimensional array (the static or dynamic one)
I've read through to use:
STATIC
=====
dim array01(2,2)
which will make an array of
(0,0) (0,1) (0,2)
(1,0) (1,1) (1,2)
right?
for DYNAMIC
=========
redim array02(2,2)
which will make exactly the same as above, but in dynamic we can extend them, right?
okay... now assume I would like to have value inside array:
array01(0,0) = "some word"
array01(0,1) = some_integer
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?
View Replies
View Related
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:
View Replies
View Related
is there any way tohave an array where the first subscript is dynamic and the second subscript is static
View Replies
View Related
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?
View Replies
View Related
I am wondering if its possible to load two array ad use one as item title and the other as value, ex:
array1 = "Sally, Jason, Jackson, Marie"
array2 = "24, 54, 21, 33"
For ....
TempSally(Sally) = 24
TempJason(Jason) = 54
....
Next....
View Replies
View Related
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?
View Replies
View Related
Hello all,
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
everytime it fails at the UBound line.
View Replies
View Related
It is mainly HTML and JavaScript, but it is built on an ASP page. I just wanted to know what the code is to make a form button that will download a file when clicked on. Such as, when a user clicks the "Click here to download" button, using javascript, it will go get that file.
Either that, or make a webpage that will use a string to download the file from a certain directory, such that, if the page is download.asp?file=office, then the server would go to a specific directory and download say, office.zip, or make it so that two arguments are passed, such as download.asp?file=office&type=zip, so it know to look for office.zip in the specific directory.
View Replies
View Related
Which would be faster?
1) Bubble sort
2) Join Array remove empty delimaters and then Split.
I am thinking the second would be a faster routine wouldn't it?
View Replies
View Related
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.
View Replies
View Related
I have an array where the data is pulled from a DB. I output the results of the DB like this:
<%=myArray_MenuIdeas(4,i)%>
where "4" is the recordset field from the DB.
The actual record being output looks like this: 4444, 1211, 2222
I need to add links to each of these values in this array.
how can I do this?!
View Replies
View Related
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:
View Replies
View Related
I have a date field in an MS Access database. I need to sort this field and print the results to an ASP page. I have done this plenty of times before except this time the date field data includes BCE data. A sample of the data in the date field is as follows:
1300 BCE
930 BCE
November 29, 1947
May 14, 1948
1465 CE
October 29, 1956
1020 BCE
I know that I can not have the data type of the MS Access field set to date/time. I searched online and didn't find too much.
View Replies
View Related
I have a date field in an MS Access database. I need to sort this field and print the results to an ASP page. I have done this plenty of times before except this time the date field data includes BCE data. A sample of the data in the date field is as follows:
1300 BCE
930 BCE
November 29, 1947
May 14, 1948
1465 CE
October 29, 1956
1020 BCE
I know that I can not have the data type of the MS Access field set to date/time. I searched online and didn't find too much.
View Replies
View Related
I like to pull the top 5 record that are closest to the current date but the date field can not be empty, see some records do not get assigned an expire date and others do. I want to show the closest expiring records.
objconn.commandtext = "SELECT TOP 5 * FROM merchants ORDER BY Expires"
What do I need to add to exclude the emtpy expires field records.
View Replies
View Related
I have files in a folder that I am using the FileSystemObject to read. I can read the files and display links to them no problem, what I want to do is to sort them by date created.What is the best way to go about this?
View Replies
View Related
I've gotten a subroutine to almost work as I want it to, but it's refusing to show the newest file. It seems to choke on files created near midnight, just never showing them at all, and the date compare is showing an equal number for two different dates, though it surely shouldn't.
The code is running here: http://www.devedia.com/wiki/
The object is to show most recent file first, oldest file last. I have some leftover code in here to organize files by month created, but I removed the folders for debugging. The program moves any files created the previous month into a folder on the first of the month.
The folder name passed in is an X for recent files, a folder name (like 2005_04) when the files were sorted by folders.
What I'm hoping for from the intelligent people in the forum is either an eyeball on the subroutine to help me find where it's losing the midnight/most recent files, or a better idea on sorting by created date using the file system object and asp only. (NO recordset objects.)
And here is the subroutine. (sorry about the indenting... copy and paste it to read it better?)
Code: ...
View Replies
View Related
I would like to get the full date of every Saturday in the year in an array - starting with the very last Saturday of last year, and ending with the first Saturday of next year. Is there a way to do this using the vbscript date functions?
View Replies
View Related
Is it possible to read the all filenames from a directory? Basically I want to grab all the filenames from a directory and make a flat file with all the values in it.
View Replies
View Related
I am developing a school Intranet and have an ASP page that allows students to upload files to the server for marking by teachers.
Unfortunately students often do not identify themselves correctly in the work they submit, so I am trying to find code that changes the name of the file they upload, by adding the their login name. (the the server variable AUTH_USER.)
AUTH_USER is easy to get but to perform the concatenation has me stumped.
View Replies
View Related
I'm using the input File method for users to upload their files to a folder on a website, I wanted to store the filename in the database but the information that is produced from the input File is an absolute path to the file on the users system (ie. c:/usersfolder/usersfile.doc)
where as I only want the filename (usersfile.doc). I am presuming that this is going to be a Split method but is there a decent place to find a tutorial on this. I've had a good google but can't seem to find anything.
View Replies
View Related
I must have about 300 images I intend to manually type into a database. Aaaaargh! I was hoping someone might be able to give me a script that if I were to place all the files on a server, I could access the directory, and loop through each of the files, storing the name in a field... Can it be done?
View Replies
View Related
I would like to read the contents of folder and display filtered results in my page.
View Replies
View Related
I've used asp upload before to upload single files to my server and write the name of the file to a database. I'm now trying to upload two files and write each file name to a different field in a record.
Currently my code says: ....
View Replies
View Related
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.
View Replies
View Related
I get error when I try to ReDim and Preserve a Dynamic Multidimensional Array. Code:
View Replies
View Related
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:
View Replies
View Related
I'm writing a shopping cart system, and the item listings have thumbnails along the left side, kind-of like the layout of eBay. This works fine and dandy unless the filename happens to have a space in it. When there's a space, the Url ends where the space is. I tried using the replace function, but to no avail. I tried ItemPic=(replace(ItemPic," ","%20")
However, the filename then becomes something like Cool%2520Item.jpg instead of Cool%20Item like it needs to be. If anyone has a solution other than going through about 10000 pictures and renaming the ones with spaces on how to make this work. Code:
View Replies
View Related
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:
View Replies
View Related
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.
View Replies
View Related
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
View Replies
View Related