Hi
I want to reverse a folder listing, can I referre to a collection with a
item number like in arrays?
ex:
set fs=Server.CreateObject("Scripting.FileSystemObject ")
set fo=fs.GetFolder(smp)
for each subfld in fo.subfolders
..
..
next
can I do the FOR statement reverse without putting all folder names into an
array. 6 2631
I don't quite follow. What is in
..
..
?
"news.microsoft.com" <klæj> wrote in message
news:O$**************@TK2MSFTNGP11.phx.gbl... Hi
I want to reverse a folder listing, can I referre to a collection with a item number like in arrays?
ex: set fs=Server.CreateObject("Scripting.FileSystemObject ") set fo=fs.GetFolder(smp) for each subfld in fo.subfolders . . next
can I do the FOR statement reverse without putting all folder names into
an array.
I think what he wants to do is something like:
Set subFolders = fo.Subfolders
For i = 0 to subFolders.Count
response.write subFolders(i).Name
Next
which you cannot do with the subfolders collection.
instead of
for each x in fo.subfolders
response.write x.name
next
Ray at home
--
Will trade ASP help for SQL Server help
"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:uZ**************@TK2MSFTNGP11.phx.gbl... I don't quite follow. What is in
. .
?
"news.microsoft.com" <klæj> wrote in message news:O$**************@TK2MSFTNGP11.phx.gbl... Hi
I want to reverse a folder listing, can I referre to a collection with a item number like in arrays?
ex: set fs=Server.CreateObject("Scripting.FileSystemObject ") set fo=fs.GetFolder(smp) for each subfld in fo.subfolders . . next
can I do the FOR statement reverse without putting all folder names into an array.
U right Ray, that is what I wanted.
Ok, no big problem, just takes longer to execute my code if I have to put
folder names into an array.
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl... I think what he wants to do is something like: Set subFolders = fo.Subfolders For i = 0 to subFolders.Count response.write subFolders(i).Name Next
which you cannot do with the subfolders collection.
instead of
for each x in fo.subfolders response.write x.name next
Ray at home
-- Will trade ASP help for SQL Server help
"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message news:uZ**************@TK2MSFTNGP11.phx.gbl... I don't quite follow. What is in
. .
?
"news.microsoft.com" <klæj> wrote in message news:O$**************@TK2MSFTNGP11.phx.gbl... Hi
I want to reverse a folder listing, can I referre to a collection with
a item number like in arrays?
ex: set fs=Server.CreateObject("Scripting.FileSystemObject ") set fo=fs.GetFolder(smp) for each subfld in fo.subfolders . . next
can I do the FOR statement reverse without putting all folder names
into an array.
Why do you think using a "for each" statement is putting anything into an
array? It is not. http://msdn.microsoft.com/library/de...stmForEach.asp
Paul
"news.microsoft.com" <klæj> wrote in message
news:Oh**************@tk2msftngp13.phx.gbl... U right Ray, that is what I wanted. Ok, no big problem, just takes longer to execute my code if I have to put folder names into an array.
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message news:%2***************@TK2MSFTNGP11.phx.gbl... I think what he wants to do is something like: Set subFolders = fo.Subfolders For i = 0 to subFolders.Count response.write subFolders(i).Name Next
which you cannot do with the subfolders collection.
instead of
for each x in fo.subfolders response.write x.name next
Ray at home
-- Will trade ASP help for SQL Server help
"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message news:uZ**************@TK2MSFTNGP11.phx.gbl... I don't quite follow. What is in
. .
?
"news.microsoft.com" <klæj> wrote in message news:O$**************@TK2MSFTNGP11.phx.gbl... > Hi > > I want to reverse a folder listing, can I referre to a collection
with a > item number like in arrays? > > ex: > set fs=Server.CreateObject("Scripting.FileSystemObject ") > set fo=fs.GetFolder(smp) > for each subfld in fo.subfolders > . > . > next > > can I do the FOR statement reverse without putting all folder names into an > array. > >
He doesn't. klæj wants to iterate through the subfolders in reverse order,
i.e., not the order they come out in the For Each loop. In order to do
this, klæj has to first iterate through the subfolders in their initial
order, while storing them into an array. Once the subfolders are in an
array, they can be iterated through in reverse order using step -1. klæj
was lamenting over the fact that doing this makes the code slower.
HTH-Jon
"Paul Baker" <ask> wrote in message
news:O2**************@TK2MSFTNGP11.phx.gbl... Why do you think using a "for each" statement is putting anything into an array? It is not.
http://msdn.microsoft.com/library/de...us/script56/ht
ml/vsstmForEach.asp Paul
"news.microsoft.com" <klæj> wrote in message news:Oh**************@tk2msftngp13.phx.gbl... U right Ray, that is what I wanted. Ok, no big problem, just takes longer to execute my code if I have to
put folder names into an array.
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message news:%2***************@TK2MSFTNGP11.phx.gbl... I think what he wants to do is something like: Set subFolders = fo.Subfolders For i = 0 to subFolders.Count response.write subFolders(i).Name Next
which you cannot do with the subfolders collection.
instead of
for each x in fo.subfolders response.write x.name next
Ray at home
-- Will trade ASP help for SQL Server help
"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message news:uZ**************@TK2MSFTNGP11.phx.gbl... > I don't quite follow. What is in > > . > . > > ? > > > > > "news.microsoft.com" <klæj> wrote in message > news:O$**************@TK2MSFTNGP11.phx.gbl... > > Hi > > > > I want to reverse a folder listing, can I referre to a collection with a > > item number like in arrays? > > > > ex: > > set fs=Server.CreateObject("Scripting.FileSystemObject ") > > set fo=fs.GetFolder(smp) > > for each subfld in fo.subfolders > > . > > . > > next > > > > can I do the FOR statement reverse without putting all folder
names into > an > > array. > > > > > >
Oh, okay :) I too am lamenting.
Paul
"Jon Mundsack" <mu******@rochester.rr.com> wrote in message
news:bg************@ID-168020.news.uni-berlin.de... He doesn't. klæj wants to iterate through the subfolders in reverse
order, i.e., not the order they come out in the For Each loop. In order to do this, klæj has to first iterate through the subfolders in their initial order, while storing them into an array. Once the subfolders are in an array, they can be iterated through in reverse order using step -1. klæj was lamenting over the fact that doing this makes the code slower.
HTH-Jon
"Paul Baker" <ask> wrote in message news:O2**************@TK2MSFTNGP11.phx.gbl... Why do you think using a "for each" statement is putting anything into
an array? It is not.
http://msdn.microsoft.com/library/de...us/script56/ht ml/vsstmForEach.asp Paul
"news.microsoft.com" <klæj> wrote in message news:Oh**************@tk2msftngp13.phx.gbl... U right Ray, that is what I wanted. Ok, no big problem, just takes longer to execute my code if I have to put folder names into an array.
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in
message news:%2***************@TK2MSFTNGP11.phx.gbl... > I think what he wants to do is something like: > Set subFolders = fo.Subfolders > For i = 0 to subFolders.Count > response.write subFolders(i).Name > Next > > which you cannot do with the subfolders collection. > > instead of > > for each x in fo.subfolders > response.write x.name > next > > Ray at home > > -- > Will trade ASP help for SQL Server help > > > "Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message > news:uZ**************@TK2MSFTNGP11.phx.gbl... > > I don't quite follow. What is in > > > > . > > . > > > > ? > > > > > > > > > > "news.microsoft.com" <klæj> wrote in message > > news:O$**************@TK2MSFTNGP11.phx.gbl... > > > Hi > > > > > > I want to reverse a folder listing, can I referre to a
collection with a > > > item number like in arrays? > > > > > > ex: > > > set fs=Server.CreateObject("Scripting.FileSystemObject ") > > > set fo=fs.GetFolder(smp) > > > for each subfld in fo.subfolders > > > . > > > . > > > next > > > > > > can I do the FOR statement reverse without putting all folder
names into > > an > > > array. > > > > > > > > > > > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Marc L'Ecuyer |
last post by:
Hi,
I have a collection class derived from CollectionBase. This collection can
add items of my class MyItem. In my class MyItem, I have a Selected
property. When this property is set to true, I...
|
by: Gerry Abbott |
last post by:
Hi all.
Could someone tell me is this number fixed when the item is created, or can
it be changed?
So for example if there are three forms, with index 0,1,2
and form 1 is deleted, does form...
|
by: Peder Y |
last post by:
Anyone knows if there is some kind of property or function that will
return the last selected/deselected item/index in a multiselect
ListBox? SelectedIndex will point to first index in the...
|
by: JohnR |
last post by:
From reading the documentation, this should be a relatively easy thing. I
have an arraylist of custom class instances which I want to search with
an"indexof" where I'm passing an instance if the...
|
by: jmhmaine |
last post by:
I've created a lookup class for a windows form application and I'm stuck on
how on using the collection object. The process is simple, if the item is in
the collection then return that object, if...
|
by: Nathan Sokalski |
last post by:
I have a control that I want displayed in all items except the last one. I
figured the best way to do this was to determine whether the current item
was the last from within the ItemDataBound event...
|
by: Mike |
last post by:
Hi,
I have a collection object bound to a data grid, after I remove an
item from the collection, the minute I click on the datagrid I get an
error saying the specified argument was out of the...
|
by: Steve Richter |
last post by:
Does the .NET framework provide a class which will find the item in
the collection with a key which is closest ( greater than or equal,
less than or equal ) to the keys of the collection?
ex:...
|
by: bilgekhan |
last post by:
After doing a succcessful insert() or find() on a set<Tcontainer
is it possible to get the item number of this item in the set?
(ie. its zero-based sequence number (position/location/rank/index)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |