Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


For Each A In B Next -- loop problem

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> For Each A In B Next -- loop problem
  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 >>
 For Each A In B Next -- loop problem - 11/1/2008 3:46:39 PM   
  TKS


Posts: 187
Score: 0
Joined: 5/16/2008
Status: offline
I'm designing an Image Previewer custom hta in vbs and javascript.
Here's the code I've come up with so far for previewing images :


      

Definition : The above code populates the innerHTML of a div with images in a directory.

This code works, but it has one flaw.
It shows all the images in a given directory, which can be slow/ problematic.
I would like to know how to show only 20 images at a time.
And I guess this would involve an image bar right? "<<  <  [ 1 ] [2] [3] [4>  >>"
So if I click "1", it loads the first 20 images, but if I click "2" it loads the second 20 images.
"<<" would stand for the first 20.
"<" would stand for the previous 20.
">>" would stand for the last 20.
">" would stand for the next 20.

I know this is a lot to ask.
You guys don't have to give me all the answers here if you don't want to.
All I really need is a push in the right direction.
TNO, Dm... dudes... I'd dig to hear your opinions on the matter too if you're not too busy.
Looking forward to your responses.
TKS.

< Message edited by TKS -- 11/1/2008 3:53:17 PM >
 
 
Post #: 1
 
 RE: For Each A In B Next -- loop problem - 11/1/2008 8:24:19 PM   
  TKS


Posts: 187
Score: 0
Joined: 5/16/2008
Status: offline
Ok I'm on the job guys. I think I might be getting somewhere... when I've finished compiling something I'll post it up here. *feels excited*

(in reply to TKS)
 
 
Post #: 2
 
 RE: For Each A In B Next -- loop problem - 11/2/2008 2:01:01 AM   
  TKS


Posts: 187
Score: 0
Joined: 5/16/2008
Status: offline

      

For some reason the code above isn't working the way I intended it to.

Its supposed to only display the first 20 images in the set, but it still displays them all.

Any ideas to what the problem might be?

(in reply to TKS)
 
 
Post #: 3
 
 RE: For Each A In B Next -- loop problem - 11/2/2008 2:54:30 AM   
  TKS


Posts: 187
Score: 0
Joined: 5/16/2008
Status: offline
I've gone an ditched the previous script...


      

Still working still waiting for some help.

(in reply to TKS)
 
 
Post #: 4
 
 RE: For Each A In B Next -- loop problem - 11/3/2008 6:43:25 AM   
  TKS


Posts: 187
Score: 0
Joined: 5/16/2008
Status: offline
Ok, I'm officially lost on this one. Haven't come up with anything that works yet... anyone got any pointers? tips? anything?

(in reply to TKS)
 
 
Post #: 5
 
 RE: For Each A In B Next -- loop problem - 11/3/2008 7:43:29 AM   
  ehvbs

 

Posts: 2224
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi TKS,

some code to get you started:


      

Good luck!

ehvbs

(in reply to TKS)
 
 
Post #: 6
 
 RE: For Each A In B Next -- loop problem - 11/4/2008 11:06:42 AM   
  TKS


Posts: 187
Score: 0
Joined: 5/16/2008
Status: offline
Hey ehvbs thanks for the code buddy! Can't wait to dig my teeth into it, but before I do I was just wandering. I ran the thing in a .vbs file and it gave me "The handle is invalid" error at line 6. What could be wrong?

< Message edited by TKS -- 11/4/2008 11:16:57 AM >

(in reply to ehvbs)
 
 
Post #: 7
 
 RE: For Each A In B Next -- loop problem - 11/4/2008 12:46:24 PM   
  dm_4ever


Posts: 2728
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
If you ever see something like this

WScript.Stdout.Writeline

....it means you need to use it using CScript.exe instead of WScript.exe....so start > run > cmd > cscript.exe scriptname.vbs

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to TKS)
 
 
Post #: 8
 
 RE: For Each A In B Next -- loop problem - 11/5/2008 11:10:24 AM   
  TKS


Posts: 187
Score: 0
Joined: 5/16/2008
Status: offline
Hey dm thanks for the help. ehvb's script works beautifully now!




Its been a busy day but I finally put something together.
See if you guys like it (I think it might have a few bugs but its working nicely)


      

(in reply to dm_4ever)
 
 
Post #: 9
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> For Each A In B Next -- loop problem 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