![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Paginate results of an FSO file list Hi, I'm using vbscript to display a list of images in a folder. Is it possible to paginate the results, so that if there are over 50 images in a folder, I can limit the amount of images shown? Thanks in advance, i11 |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Paginate results of an FSO file list "i11usive" <i11usive007@xxxxxx> wrote in message news:6bc9e15b-30f4-4f46-96b1-77d001cae03c@xxxxxx Quote: > Hi, > > I'm using vbscript to display a list of images in a folder. Is it > possible to paginate the results, so that if there are over 50 images > in a folder, I can limit the amount of images shown? > it? You would also do well to explain how it is you are displaying it, in a browser? is it a HTA or is this ASP? -- Anthony Jones - MVP ASP/ASP.NET |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Paginate results of an FSO file list As Anthony Jones said, you didn't post enough information for anyone to offer a specific answer. Presumably you've got a collection of file names. A FSO Folder Files collection? Or maybe a Shell.Application ShellFolder Items collection? Assuming that you're looping through a collection with For Each you can add a counter: Set oFolder = FSO.GetFolder(path) Set oFiles = oFolder.Files iCount = 0 For Each oFile in oFiles If ucase(Right(oFile.Name, 3)) = "JPG" then '-- code here to add image to display iCount = iCount + 1 End If if iCount = 50 then Exit For Next Quote: > > I'm using vbscript to display a list of images in a folder. Is it > possible to paginate the results, so that if there are over 50 images > in a folder, I can limit the amount of images shown? > > Thanks in advance, > > i11 |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Paginate results of an FSO file list "mayayana" <mayaXXyana@xxxxxx> wrote in message news:OmCII33BJHA.3512@xxxxxx Quote: > As Anthony Jones said, you didn't post enough > information for anyone to offer a specific answer. > Presumably you've got a collection of file names. > A FSO Folder Files collection? Or maybe a > Shell.Application ShellFolder Items collection? > Assuming that you're looping through a collection > with For Each you can add a counter: > > Set oFolder = FSO.GetFolder(path) > Set oFiles = oFolder.Files > iCount = 0 > For Each oFile in oFiles > If ucase(Right(oFile.Name, 3)) = "JPG" then > '-- code here to add image to display > iCount = iCount + 1 > End If > if iCount = 50 then Exit For > Next me the next 50' is also needed. If the display is simply dumping a file list to the console then the above could be adapted so that the code remains within a single enumeration of Files. However, if the code is in a HTA displaying as HTML then the procedure would need to exit and then we'd need a way to start another enumeration 50 files in. -- Anthony Jones - MVP ASP/ASP.NET |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| ping results to html file | PowerShell | |||
| export results to tab-delimited file | PowerShell | |||
| Echo results of script to file | PowerShell | |||
| uploading script results to a csv file | PowerShell | |||
| Vista File Indexing = Incomplete results | Vista General | |||