Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > VBScript
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old February 11th, 2005, 11:41 AM
Friend of Wrox
Join Date: Jun 2004
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Default error when sorting an Array of Array

Okay I'm using FSO to fetch documents and write then into a table for retreival (my filenames are hyperlinks, too).

I want to add the additional functionality of sorting these results as well.

I was once given a link to a peice of code and while it looks like it might work I'm still having VB sript erros and I am VERY new to VBs.
Here's the error
Expected end of statement

/HR/comm_employee.asp, line 240

Dim the Files ( )

Here's the code where the error is found:

************************************************** **************

' collect all the info about each file and put it into one
' "slot" in our "theFiles" array.
For Each fileItem in curFiles
    fname = fileItem.Name
    fext = InStrRev( fname, "." )
    If fext < 1 Then fext = "" Else fext = Mid(fname,fext+1)
    ftype = fileItem.Type
    fsize = fileItem.Size
    fcreate = fileItem.DateCreated
    fmod = fileItem.DateLastModified
    faccess = fileItem.DateLastAccessed
    currentSlot = currentSlot + 1

    If currentSlot > UBound( theFiles ) Then
        ReDim Preserve theFiles( currentSlot + 99 )
    End If
    ' here's an array!
    theFiles (currentSlot) = Array' And now a loop for the files

Dim the Files ( )
ReDim theFiles( 500 ) ' arbitrary size!
currentSlot = -1 ' start before first slot(fname,fext,ftype,fsize,fcreate,fmod,faccess)

************************************************** **************

As always your help is most appreciated,
Reply With Quote
  #2 (permalink)  
Old February 16th, 2005, 12:44 PM
Friend of Wrox
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts

Which line is 240?

Reply With Quote
  #3 (permalink)  
Old February 17th, 2005, 12:57 PM
Friend of Wrox
Join Date: Jun 2004
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts

Thank you for your feedback. The problem is resolved.

Thanks again,
Reply With Quote

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting Array in C++ code_lover C++ Programming 4 October 16th, 2008 01:43 AM
Sorting 2 dimensional array rgalehouse Javascript How-To 2 December 2nd, 2006 10:46 AM
sorting two dimensional array erin VBScript 0 February 10th, 2004 05:55 PM
Array Sorting Dinesh22 VB.NET 2002/2003 Basics 2 February 3rd, 2004 11:19 AM
Sorting an array roxusername PHP How-To 1 October 14th, 2003 01:16 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.