Alpha Video Training
Results 1 to 4 of 4

Thread: Old Filefind script does not work in v9

  1. #1
    Moderator drgarytraub's Avatar
    Real Name
    Dr. Gary Traub
    Join Date
    May 2000
    Location
    Boca Raton, FL
    Posts
    2,765

    Default Old Filefind script does not work in v9

    The following script works fine in v5 (it is from an older application that I had written in v5), but not in v9:

    dim tbl as p
    tbl=table.open("[pathalias.adb_path]\reports")

    dim file_names(10000) as c

    dir_put("C:\A5Webroot\Reports")

    files=filefind.first("*.*")
    i=1
    while .not. files.eof()
    file_names(i)=files.name()
    if file_names(i)<>"." .and. file_names(i)<>".."
    tbl.enter_begin()
    tbl.Fname=file_names(i)
    tbl.enter_end()
    end if
    files.next()
    i=i+1
    end while

    tbl.close()

    I know that filefind.first has been depracated and replaced by filefind.get, but that line is not what is producing the error. I get an error at the line that reads: file_names(i)=files.name()

    Can someone please help figure out how to make this script work in v9?

    Gary

  2. #2
    Member ColinJD's Avatar
    Real Name
    Colin Davies
    Join Date
    Jun 2006
    Location
    NZ
    Posts
    481

    Default Re: Old Filefind script does not work in v9

    Dr Gary,
    This should be working, I use similar code, and it runs.
    Silly question, but does the account have the correct security to Browse a directory?
    Security has changed stacks from 5 to 9

  3. #3
    Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,560

    Default Re: Old Filefind script does not work in v9

    Wasn't it version 6 that changed the syntax for an array?

    file_names(i)=files.name()

    became

    file_names[i]=files.name()
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  4. #4
    Moderator drgarytraub's Avatar
    Real Name
    Dr. Gary Traub
    Join Date
    May 2000
    Location
    Boca Raton, FL
    Posts
    2,765

    Default Re: Old Filefind script does not work in v9

    Al,

    That was it. Thanks!!!!!

    Gary

Similar Threads

  1. This "filefind.get" and loop should work, I think...
    By georgefurnel in forum Alpha Five Version 8
    Replies: 9
    Last Post: 03-25-2008, 11:46 AM
  2. Action Script won't work with v6
    By Tim Sutherland in forum Alpha Five Version 6
    Replies: 3
    Last Post: 08-02-2005, 10:07 AM
  3. Why does this script not work?
    By Graham Wickens in forum Alpha Five Version 5
    Replies: 7
    Last Post: 05-24-2005, 12:56 PM
  4. filefind.List_New_Files does not work on WAS
    By Howard G. Cornett in forum Web Application Server v6
    Replies: 2
    Last Post: 04-18-2005, 02:36 PM
  5. Why won't this Xbasic script work?
    By Themis Skiathitis in forum Alpha Five Version 4
    Replies: 6
    Last Post: 05-22-2001, 12:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •