Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


skip to next in loop

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,46918
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> skip to next in loop
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 skip to next in loop - 5/9/2007 9:51:50 PM   
  darkmunk

 

Posts: 4
Score: 0
Joined: 1/16/2007
Status: offline
I have a loop which successfully populates a drop down with filenames but if the filename ends in 'LCK' I would like the loop to miss out that name. I have tried all sorts but nothing works properly. any ideas, thanks.
My code:
[code]
select name="event" id="event">
<option value="">Please select... </option>
<%
set fso=Server.CreateObject("Scripting.FileSystemObject")
myPath = Server.MapPath("/races/")
set fObj=fso.GetFolder(myPath)
for each x in fObj.files
'if Right(x.name,3) = "LCK" then ---- miss out this filename and move to the next ----

 fileNameX = x.Name 
 baseName = fso.GetBaseName(myPath &"\"& fileNameX)
 trimBaseName =(Mid(baseName,3))

%>
<option value="<%=trimBaseName%>"><%=trimBaseName%></option>
<%
next
set fo=nothing
set fs=nothing
%>
</select>[/CODE]
 
 
Post #: 1
 
 RE: skip to next in loop - 5/9/2007 10:41:38 PM   
  darkmunk

 

Posts: 4
Score: 0
Joined: 1/16/2007
Status: offline
Fixed ...


      

(in reply to darkmunk)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> skip to next in loop Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts