Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 1 of 1
  1. #1
    Join Date
    Sep 2008
    Posts
    9

    Arrow File.Find Error Help Please

    -- Gets the path to the user's My Documents folder.
    my_docs_path = Dialog.FolderBrowse("Selecciona :", "C:\\");

    if
    my_docs_path =="CANCEL" then

    else
    sFile = File.Find(my_docs_path, "*.txt", true, false, nil, nil);
    for i, value in sFile do
    Paragraph.SetText("Paragraph1", String.AbbreviateFilePath(value, 45)); ---path progress in text

    end

    if (sFile== nil) then

    else


    result = Dialog.Message("Notice", "found.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);

    end
    Paragraph.SetText("Paragraph1", "end...");
    end


    The problem occurs when looking for a disc which contains *. txt or a blank disc is click on the following error, line 21: attemp to call to nil value, some help please


    sorry my English is very bad, I speak Spanish
    Last edited by kankan; 06-16-2009 at 11:54 AM. Reason: bad bad writing

  2. #2
    Join Date
    Oct 2007
    Location
    Gensokyo
    Posts
    1,324
    If File.Find can't find anything, It returns a nil value. This means you should check if the type of the return value is a table or not.

Posting Permissions

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