Error loading empty csf file

Discussion in 'Bug Reports' started by Scubaticus, Jul 7, 2007.

  1. Scubaticus

    Scubaticus Active Member Licensed User

    When I try to load an empty but existing csv with loadCSV, it rises the error "Index was outside the bounds of the array" (loadCVS("csv", ",", FALSE, FALSE)

    When i do the same with an headered csv file I don't get errors.

    How to find out if an csv file without headers is empty? I could use errorlabel I guess, but I want to know if there are records or not and not if the file exists or not.

  2. Erel

    Erel Administrator Staff Member Licensed User

    You could check the file size using FileSize.
    An empty CSV file with no headers should be an empty file.
  3. Scubaticus

    Scubaticus Active Member Licensed User

    Well, not complete emtpy. It returns 3 bytes.
    But writing en empty table with saveCSV is no problem an causes no error.

    Perhaps it's an idea to return the actual records readed or written to csv?

    RecsIn = loadCSV(..)

    But for now the filesize will do. Thanks for your quick reply.

  4. agraham

    agraham Expert Licensed User

    Excuse my ignorance and jumping in to your thread, but loadCSV looks useful but where is it located? I'm probably being stupid but it's not a native sub and I can't seem to find any component with it in?

    EDIT : I was being stupid, I've found it now. I didn't expect it to be a control method.:sign0161:
    Last edited: Jul 7, 2007
  5. dzt

    dzt Active Member Licensed User

    Look at table control
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice