Finder can't continue recursive function

I'm trying to write a recursive function that returns a nested list representing the directory structure (including files) below a starting path. When I run my function, I get an error: "Applescript Error: Finder got an error: Can't continue getDirectoryStructure." This error appears at the first subfolder encountered.
This is one of those "spot my mistake" kind of posts, because I am completely lost. I don't see why it shouldn't be able to continue with my recursive function. Here's the code:
on getDirectoryStructure(startPath)
tell application "Finder"
set dirList to {}
set tempDirList to (get items of folder startPath)
repeat with curItem in tempDirList
if (class of curItem is folder) then
set end of dirList to getDirectoryStructure(startPath & ":" & name of curItem)
else
set end of dirList to curItem
end if
end repeat
end tell
return dirList
end getDirectoryStructure
getDirectoryStructure("Filibuster II:Users:ryos:Documents")

I didn't realize I could display this a little better, I'm new to the list, and slowly getting it figured out.
This is a re-post of my previous message...
on script_title()
   Filename : minimaldirtraversal.scpt (Script Debugger)
   Author : Bill Hernandez
   Version : 1.0.0
   Updated : Saturday, December 16, 2006 ( 3:18 PM )
end script_title
-- ---------+---------+---------+------------------
on script_notes()
   I took one of my directory traversal routines, and took a bunch of stuff
   out of it, to create this for you...
   Hope it helps,
   Bill Hernandez
end script_notes
-- ---------+---------+---------+------------------
property gtimestart : ""
property gtimeend : ""
-- ---------+---------+---------+------------------
-- PROPERTIES REQUIRED FOR PROCESSING TRAVERSAL
-- ---------+---------+---------+------------------
property aFound : {}
property aIgnored : {}
property aFileTypes : {"TEXT"}
property aExtensions : {"txt", "text", "applescript", "html", "php"}
-- ---------+---------+---------+------------------
-- SYSTEM PATHS
-- ---------+---------+---------+------------------
property gdirpathhome : ""
property gdirpathdesktop : ""
property gdirpathdocs : ""
property gdirpathprefs : ""
property gdirpathtemp : ""
-- ---------+---------+---------+------------------
property gtextdelim : ":"
property g_Divider : "--------------------------------------------------" & return
-- ---------+---------+---------+------------------
property aErrors : {} -- list of errors
property gshow_errormessages : true -- set to false to prevent error messages from displaying
property gsend_error_messages_tolog : true
property g_continue : true -- use this instead of [if (not(g_abort)) then]
-- ---------+---------+---------+------------------
on run
   set w_props to {contents:""}
   --set w_id to my bb_CkWindowExists("Dummy Work Document", "", w_props) -- REMOVE THIS LINE, USED FOR TESTING
   tell me
      InitGlobals()
      set which to "selectchoosefolder" -- aChoices -> { "selectcurrentdocument", "selectopendocuments", "selectchoosefolder"}
      main(which) -- place your code in [main]
   end tell
end run
-- ---------+---------+---------+------------------
on main(whichAction) -- This is the [main handler] called by [on run]
   -- THIS IS A BASIC SHELL FOR ANY SCRIPT
   my ProcessRequest(whichAction)
   if (g_continue) then
      set str to "" -- If this set to "", the following will be used "Would you like to continue processing now?"
      -- REMOVE NEXT LINE, USED FOR TESTING
      set str to str & "Found : ( " & (count items in aFound) & " ) files..." & return & "Time to process : " & (gtimeend - gtimestart) & " seconds..." & return & return
      if (my ConfirmRequest(str)) then
         repeat with thisItem in aFound
            -- PROCESS EACH (FILE, WINDOW, or DOCUMENT) HERE
            -- ******* DO THE WORK HERE
         end repeat
      end if
   end if
   set error_title to "Problem Found:" & return & "NOTIFY APPLE COMPUTER"
   my error_HandleErrors(aErrors, error_title, gshow_errormessages, gsend_error_messages_tolog)
   tell application "BBEdit" to activate
end main
-- ---------+---------+---------+------------------
on ProcessRequest(whichAction)
   -- Having "if (whichAction..." here is redundant, instead of having it below, but makes it easier not having to repeat "set gtimestart..." several times
   if (whichAction = "selectchoosefolder") then
      set startFolder to my ChooseFolder("Select the folder where the files you want to combine are stored?")
   end if
   -- MAKE SURE "set gtimestart..." COMES AFTER "ChooseFolder(...)"
   set gtimestart to (current date) -- REMOVE THIS LINE, USED FOR TESTING
   if (g_continue) then
      if (whichAction = "selectopendocuments") then
      else if (whichAction = "selectchoosefolder") then
         my processDirectory(startFolder)
      else if (whichAction = "selectcurrentdocument") then
      else
         set aFound to {}
      end if
   end if
   set gtimeend to (current date) -- REMOVE THIS LINE, USED FOR TESTING
end ProcessRequest
-- ---------+---------+---------+------------------
on InitGlobals()
   set aErrors to {} -- list of errors
   set gdirpathhome to (path to home folder from user domain as text)
   set gdirpathdesktop to (path to desktop from user domain as text)
   set gdirpathdocs to (path to documents folder from user domain as text)
   set gdirpathprefs to (path to preferences folder from user domain as text)
   set gdirpathtemp to (path to temporary items folder from user domain as text)
   set g_continue to true
   set aFound to {}
   set aIgnored to {}
end InitGlobals
-- ---------+---------+---------+------------------
on ChooseFolder(s)
   tell application "Finder"
      activate
      if (s = "") then
         set str to "Select the folder you wish to traverse?"
      else
         set str to s
      end if
      try
         return choose folder with prompt str
      on error
         set g_continue to false
         tell application "BBEdit" to activate
      end try
   end tell
end ChooseFolder
-- ---------+---------+---------+------------------
on ConfirmRequest(s)
   tell application "BBEdit"
      activate
      set b1 to "Go Ahead..."
      set b2 to "Forget It!"
      set str to s & "Would you like to continue processing now?"
      set aResult to display dialog str buttons {b1, b2} default button {b1}
      if ((button returned of aResult) = b1) then
         return true
      else
         return false
      end if
   end tell
end ConfirmRequest
-- ---------+---------+---------+------------------
on date_GetFullDate(theDate)
   set ds to date string of (theDate)
   set TS to time string of (theDate)
   tell application "Finder"
      set TS to ((get characters 1 thru -7 of TS) & (get characters -3 thru -1 of TS)) as string
   end tell
   set FD to (ds & " (" & TS & ")")
   return FD
end date_GetFullDate
-- ---------+---------+---------+------------------
on processDirectory(thisFolder)
   tell application "Finder"
      set aItems to (get every item of folder thisFolder)
   end tell
   repeat with I from 1 to the count of aItems
      set thisItem to (item I of aItems as alias)
      set itemInfo to info for thisItem
      set itemName to (name of itemInfo)
      if ((folder of itemInfo) is true) then
         my processDirectory(thisItem) -- It is a FOLDER
      else if ((visible of itemInfo is true) and (alias of itemInfo is false)) then
         if (((file type) of itemInfo) is in aFileTypes) then
            set aFound to aFound & thisItem -- It is a valid file
         else if (((name extension) of itemInfo) is in aExtensions) then
            set aFound to aFound & thisItem -- It is a valid file
         else
            set aIgnored to aIgnored & thisItem -- It is NOT a valid file
         end if
      else
         set aIgnored to aIgnored & thisItem -- It is NOT a valid file
      end if
   end repeat
end processDirectory
-- ---------+---------+---------+------------------
on error_HandleErrors(aErrorList, header_str, display_error, send2log)
   if (header_str = "") then
      set myheaderstr to "Errors were encountered during script execution..."
   else
      set myheaderstr to header_str
   end if
   if ((count of aErrorList) > 0) then
      set s to ""
      repeat with my_error in aErrorList
         set s to s & my_error & return & return
      end repeat
      set s to header_str & return & return & s
      if (display_error) then
         display dialog s buttons {"OK"} default button {"OK"} with icon stop giving up after 15
      end if
      if (send2log) then
         -- NEED TO INCLUDE ROUTINE TO SEND ERRORS TO THE LOG
         -- next line is normally enabled
         -- my writetofile(s, gfilepathlog, true) -- { (true -> append_data), (false -> overwrite) }
      end if
   end if
end error_HandleErrors
-- ---------+---------+---------+------------------

Similar Messages

  • The InitCVIRTE function is not listed in the NIDAQ function reference online help? Why? and where can I find a description of this function?

    the InitCVIRTE function is not listed in the NIDAQ function reference online help? Why? and what does she do?and where can I find a description of this function? Can i use this function with visualc++ 6.0?

    The InitCVIRTE function is in the CVI run time engine (cvirte.dll)..not part of NI-DAQ.
    Applications written or using CVI may call this function..
    How are you running into this ?
    From the CVI help...
    This function performs initialization of the CVI Run-Time Engine. It is needed only in executables or DLLs that are linked using an external compiler. Otherwise, it is harmless.
    It should be called in your main, WinMain, or DllMain, function. The parameter values you should pass depend on which of these three functions you are calling InitCVIRTE from. The following examples show how to use InitCVIRTE in each case.
    If you are using main, your code should be as follows.
    int main (int argc, char *argv[])
    if (InitCVIRTE (0, argv, 0) == 0)
    return -1; /* out of memory */
    /* your other code */
    return 0;
    If you are using WinMain, your code should be as follows.
    int __stdcall WinMain (HINSTANCE hInstance,
    HINSTANCE hPrevInstance,
    LPSTR lpszCmdLine,
    int nCmdShow)
    if (InitCVIRTE (hInstance, 0, 0) == 0)
    return -1; /* out of memory */
    /* your other code */
    return 0;
    If you are creating a DLL, you must call InitCVIRTE and CloseCVIRTE in your DllMain function, as in the following.
    int __stdcall DllMain (void *hinstDLL, int fdwReason,
    void *lpvReserved)
    if (fdwReason == DLL_PROCESS_ATTACH)
    if (InitCVIRTE (hinstDLL, 0, 0) == 0)
    return 0; /* out of memory */
    /* your other ATTACH code */
    else if (fdwReason == DLL_PROCESS_DETACH)
    /* your other DETACH code */
    CloseCVIRTE ();
    return 1;
    NOTE: The prototype for InitCVIRTE is in cvirte.h, not
    utility.h.
    NOTE: In CVI 4.0.1, this function was expanded from one to
    three parameters. Executables and DLLs that were
    created using the one-parameter version of the function
    will continue to work properly.
    /*-------------------- Prototype ---------------------*/
    int InitCVIRTE (void *HInstance, char *Argv[], void *Reserved);
    Nandan Dharwadker
    Staff Software Engineer
    Measurement Studio Hardware Team

  • How do I find out what year my MacBook Pro is?  I want to know if I can use the mirroring function with my Apple TV if I download Mountain Lion.

    I'm trying to find out if I can use the mirror function to look at large construction drawings using my Apple TV.  It says that my MacBook Pro has to be early 2011 or newer and I can't remember what it is.

    Mactracker - Get Info on any Mac

  • How can i find start line of any functions or procedures stored in package body?

    hi
    how can i find start line of any functions or procedures stored in package body?
    is there any way to write a query from for example user_source?
    thanks

    how can i find start line of any functions or procedures stored in package body?
    Why? What will you do differently if a procedure starts on line 173 instead of line 254?
    Tell us what PROBLEM you are trying to solve so we can help you find the best way to solve it.
    If you use PL_SCOPE that info is available in the *_IDENTIFIERS views. See 'Using PL/Scope in the Advanced Dev Doc
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28424/adfns_plscope.htm
    Try this simple sample code. The query is modified from that doc sample:
    -- tell the compiler to collect the info
    ALTER SESSION SET PLSCOPE_SETTINGS='IDENTIFIERS:ALL';
    -- recompile the package
    CREATE OR REPLACE package SCOTT.pack1 as
    PROCEDURE proc1;
    PROCEDURE proc2;
    END;
    CREATE OR REPLACE package BODY SCOTT.pack1 as
    PROCEDURE proc1 IS
    BEGIN
      NULL;
    END;
    PROCEDURE proc2 IS
    BEGIN
      proc1;
    END;
    PROCEDURE proc3 IS
    BEGIN
      proc1;
      proc2;
    END;
    END;
    -- query the info for the package spec
    WITH v AS (
      SELECT    Line,
                Col,
                INITCAP(NAME) Name,
                LOWER(TYPE)   Type,
                LOWER(USAGE)  Usage,
                USAGE_ID,
                USAGE_CONTEXT_ID
        FROM USER_IDENTIFIERS
          WHERE Object_Name = 'PACK1'
            AND Object_Type = 'PACKAGE'
    SELECT LINE, RPAD(LPAD(' ', 2*(Level-1)) ||
                     Name, 20, '.')||' '||
                     RPAD(Type, 20)||
                     RPAD(Usage, 20)
                     IDENTIFIER_USAGE_CONTEXTS
      FROM v
      START WITH USAGE_CONTEXT_ID = 0
      CONNECT BY PRIOR USAGE_ID = USAGE_CONTEXT_ID
      ORDER SIBLINGS BY Line, Col
    LINE,IDENTIFIER_USAGE_CONTEXTS
    1,Pack1............... package             declaration        
    2,  Proc1............. procedure           declaration        
    3,  Proc2............. procedure           declaration        
    -- query the info for the package body - change 'PACKAGE' to 'PACKAGE BODY' in the query above
    LINE,IDENTIFIER_USAGE_CONTEXTS
    1,Pack1............... package             definition         
    2,  Proc1............. procedure           definition         
    6,  Proc2............. procedure           definition         
    8,    Proc1........... procedure           call               
    10,  Proc3............. procedure           declaration        
    10,    Proc3........... procedure           definition         
    12,      Proc1......... procedure           call               
    13,      Proc2......... procedure           call               

  • Today I updated the OX Maverisk. It turns out that the three finger gesture in the finder( go back and forward) is disabled. How can I get this function back? I love it so much!!!

    Today I updated the OX Maverisk. It turns out that the three finger gesture in the finder( go back and forward) is disabled. How can I get this function back? I love it so much!

    Try System Preferences/Trackpad/More Gestures.

  • HT1657 my rented movie stopped and now i can't find it to continue watching it

    my rented movie stopped and now i can't find it to continue watching it

    Hello cheertalkr11,
    Thank you for using Apple Support Communities.
    For more information, take a look at:
    How to report an issue with your iTunes Store, App Store, Mac App Store, or iBooks Store purchase
    http://support.apple.com/kb/HT1933?viewlocale=en_US
    Have a nice day,
    Mario

  • Recursive function to find the parents of a tree node

    Hi,
    I need help to write a recursive function to get the parents of a tree node upto the root.The major problem is , each node can have more than one parent.I have two methods ; one to get the immediate parents(getParents() will return me a vector) and the other to get the parents upto the root(will also return me a vector).
    Thanks in advance,
    nanduvs

    let me risk a dumb response ..
    if there are multiple parents
    why not just follow the first parent
    back to the root
    if everything starts at one root

  • Where can i find clear information about sap function modules?

    where can i find clear information about sap function modules?
    for example,
    if i want to know whats the use of function module  "SAPGUI_PROGRESS_INDICATOR" .
    where i can find all the detail info..
    is there any sap transaction code for knowing about all function modules and there use?
    Regards
    Smitha

    Hi:
    For documentation, you have to find it out in se37 but it is not neccessary every Fm would have.
    Now question is about its used (if you know th e function module)-> go in se37-> put function module -> select where used list -> select used in like - program, class, BSP application etc -> click on ok; it would give the list of its used and just go in that find  how it is being used.
    if you have to find the function module for table - > go in se11 -> select table name -> click on where used list -> select function module  interface and click on ok, it would give the list of  its used.
    Otherwise go in g o o g l e dot  c o  m.
    Regards
    Shashi

  • When I type word to search in the Find box, Firefox will jump to the first grouping of letters it recognizes. I have to click back in the find box to continue typing my word. How can I make this stop?

    I wanted to search for the word "medieval" on a web page. I started typing the word in the Find box. After I had typed "med", Firefox put the cursor on the word "medicate" in the web page. I have to click back in the Find box to continue typing my word. This is extremely annoying because sometimes I have to click back in the Find box after every letter.

    Thanks for responding Chris.
    I hadn't restarted after disabling SearchMenu. Having restarted, it would appear that the problem was, in fact, SearchMenu. Which was my suspicion. Once Find highlights a "word" SearchMenu interrupts to offer its services. I guess I'll post on their board, to see if there's a solution.
    I should have restarted before posting. My apologies. Rookie move.
    Thanks again, Chris.

  • Where can i find flat sequence in a function palette

    Hello
    Where shall i find flat sequence in the function palette of LabVIEW 6.1 version.
    Please have a look at the VI in LabVIEW which i developed using LabVIEW 7.0 version, in which i used flat sequence.
    Jayaprakash
    Attachments:
    Flat sequence.doc ‏79 KB

    Hi
    The flat sequence is just available in LV version 7.0 and newer.
    In LV 6.1 you have to use the stacked sequence-structure.
    Thomas
    Using LV8.0
    Don't be afraid to rate a good answer...

  • Problem with recursive function & Exception in thread "AWT-EventQueue-0"

    I hope that title doesn't put everyone off :)
    I have a recursive function that takes in a list of words, and a reference to my current best board. I am kludging the escape function +(tryWords.size() == 0 || mTotalBlankBlocks < 200)+ atm, but eventually it will escape based on whether the current bestBoard meets certain requirements. The function makes iterates through a list of words, and finds all the spaces that the word would fit into the puzzle: getValidSpacedPositions(currentWord); - it then iterates through each of these; placing a word, removing that word from the iterator and the relevant arrayLists and then recurses the function and tries to do the same with the next word etc.
    private void computeBoards(ArrayList<Word> tryWords, Board bestBoard) {
         if (tryWords.size() == 0 || mTotalBlankBlocks < 200)
              return;
         for(Iterator<Word> iter = tryWords.iterator(); iter.hasNext(); ){
              Word currentWord = new Word();
              currentWord = iter.next();
              ArrayList<Position> positions = new ArrayList<Position>();
              positions = getValidSpacedPositions(currentWord);
              if (positions.size() != 0)
                   iter.remove();
              System.out.println();
              int placedWordsIndex = tryWords.indexOf(currentWord);
              System.out.print(placedWordsIndex+". "+currentWord.getString()+" with "+positions.size()+" positions / ");
              for (Position position : positions) {
                   System.out.println("Pos:"+(positions.indexOf(position)+1)+" of "+positions.size()+"  "+position.getX()+","+position.getY()+","+position.getZ());
                   int blankBlocksLeft = placeWord(currentWord, position);
                   if(blankBlocksLeft != 0)
                        mPlacedWords.add(currentWord);
                        // TODO: Kludge! Fix this.
                        mUnplacedWords.remove(placedWordsIndex+1);
                        System.out.println("adding "+currentWord.getString()+" to added words list");
                        Board compareBoard = new Board(blankBlocksLeft, mPlacedWords.size());
                        if (compareBoard.getPercFilled() > bestBoard.getPercFilled())
                             bestBoard = new Board(blankBlocksLeft, mPlacedWords.size());
                        //**RECURSE**//
                        computeBoards(tryWords, bestBoard);
                        mUnplacedWords.add(currentWord);
                        removeWord(currentWord);
                        System.out.println("removing "+currentWord.getString()+" from added words list");
                   else
                        System.out.println("strange error, spaces are there but word cannot place");
              System.out.println("**FINISHED ITERATING POSITIONS");
         System.out.println("**FINISHED ITERATING TRYWORDS");
    }This all seems to work fine, but I add it in for completeness because I am not sure if I have done this right. The Exception occurs in the placeWord function which is called from the recursive loop, on the line bolded. For some reason the Arraylist Words seems to initialise with size 1 even though it is a null's when I look at it, (hence all the redundant code here) and I can't seem to test for null either, it seems to works fine for a while until the recursive funciton above has to back up a few iterations, then it crashes with the exception below.
         private int placeWord(Word word, Position originPosition) {
              ArrayList<Word> words = new ArrayList<Word>();
              switch (originPosition.getAxis().getCurrInChar()) {
              case 'x':
                   // TODO: This is returning ONE!!!s
                   words = mBlockCube[originPosition.getX()][originPosition.getY()][originPosition.getZ()].getWords();
                   int tempword1 = mBlockCube[originPosition.getX()][originPosition.getY()][originPosition.getZ()].getWords().size();
                   for (int i = 0; i < word.getLength(); i++) {
                        *if (words.get(0) == null)*
                             mBlockCube[originPosition.getX() + i][originPosition.getY()][originPosition.getZ()] = new Block(word, word.getChar(i));
                        else
                             mBlockCube[originPosition.getX() + i][originPosition.getY()][originPosition.getZ()].addWord(word);
                   break;
              case 'y':
                   words = mBlockCube[originPosition.getX()][originPosition.getY()][originPosition.getZ()].getWords();
                   int tempword2 = mBlockCube[originPosition.getX()][originPosition.getY()][originPosition.getZ()].getWords().size();
                   for (int i = 0; i < word.getLength(); i++) {
                        *if (words.get(0) == null)*
                             mBlockCube[originPosition.getX()][originPosition.getY() + i][originPosition.getZ()] = new Block(word, word.getChar(i));
                        else
                             mBlockCube[originPosition.getX()][originPosition.getY() + i][originPosition.getZ()].addWord(word);
                   break;
              case 'z':
                   words = mBlockCube[originPosition.getX()][originPosition.getY()][originPosition.getZ()].getWords();
                   int tempword3 = mBlockCube[originPosition.getX()][originPosition.getY()][originPosition.getZ()].getWords().size();
                   for (int i = 0; i < word.getLength(); i++) {
                        *if (words.get(0) == null)*
                             mBlockCube[originPosition.getX()][originPosition.getY()][originPosition.getZ() + i] = new Block(word, word.getChar(i));
                        else
                             mBlockCube[originPosition.getX()][originPosition.getY()][originPosition.getZ() + i].addWord(word);
                   break;
              mTotalBlankBlocks -= word.getLength();
              word.place(originPosition);
              String wordStr = new String(word.getWord());
              System.out.println("Word Placed: " + wordStr + " on Axis: " + originPosition.getAxis().getCurrInChar() + " at pos: "
                        + originPosition.getX() + "," + originPosition.getY() + "," + originPosition.getZ());
              return mTotalBlankBlocks;
    Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
         at java.util.ArrayList.RangeCheck(Unknown Source)
         at java.util.ArrayList.get(Unknown Source)
         at com.edzillion.crossword.GameCube.placeWord(GameCube.java:189)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:740)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.generateGameCube2(GameCube.java:667)
         at com.edzillion.crossword.GameCube.<init>(GameCube.java:42)
         at com.edzillion.crossword.Crossword.actionPerformed(Crossword.java:205)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    Any ideas? I've looked up this exception which didn't shed any light...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    ArrayList<Word> words = new ArrayList<Word>();See the API Javadoc for ArrayList: this creates an empty ArrayList.
    if (words.get(0) == null)This tries to read the first element of the (still empty) array list -> throws IndexOutOFBoundsException
    If you want to stick to that logic (I am too lazy to proof-read your whole algorithm, but that should at least unblock you), you should first check whether the list actually contains at least one element:
    if (!words.isEmpty()) {...}

  • Recursive Function Question

    I've used recursive functions with other programming
    languages but I seem to be having a problem using it with a UDF in
    a cfc file. I'm reading an XSD file, parsing the XSD and populating
    an array with the details of any import tags using XMLSearch,
    looping through the array and recursively calling the same UDF to
    process the child XSD file, so on an so forth. My issue happens
    when the UDF gets to the bottom of the recursive call and is going
    back up one level to loop to the next item in the array of the
    parent UDF call. When the code returns back it gives me an error
    saying "The element at position 2 cannot be found." After some
    trouble finding out what is happening, it seems the values
    contained in the array have been purged. In my experience with
    recursive functions, the values of any past calls will still be
    available in memory once the process returns back to it. I'm a
    litte green using UDFs but I would think it should work the same
    way. Is there an issue with the scope of the array variable I am
    using? I've attached my code. Any help is appreciated.
    Thanks!

    If I wanted to keep track of which XSD files I have already
    processed,
    would I be able to insert the file names into an array or
    list across
    recursive calls? Would I need to declare it within the
    cfcomponent tag
    before the cffunction tag? Thanks again.
    Yes you can. You would create an array an either the global
    THIS
    (unfortunately the default) or the more preferred VARIABLES
    scope. The
    this scope is public, the variables scope is private to the
    component.
    You can declare this global variable in the "pseudo
    constructor" space
    at the head of the component - which is the space between the
    opening
    <cfcomponent> tag and the first opening
    <cffunction> tag. You could
    also declare this global variable in another initialization
    style
    function that is called before your iteration function is
    called
    initially.
    You would then access and update the values in the global
    variable
    inside your iteration function just by calling it as
    this.aVariable or
    variables.aVariable.

  • HT204053 Does the MobileMe iDisk continue to function in iCloud?

    I like to use the iDisk to share files between my PowerMac and Macbook.  I can't tell from the iCloud web site whether or not iDisk will continue to function after MobileMe is cut off.  Will it?

    Welcome to the Apple community.
    Unfortunately, iCloud does not offer equivalents to Mobile Me’s iDisk, Gallery or Web Hosting services. You will need to find a third party solution to replace these services. You might consider DropBox, SugarSync, MediaFire or any other service that offers online storage. (not all these alternatives offer all the services previously provided by iDisk)

  • HT1848 when i purchase ringtones and they download directly to the music app on iphone, how can I move them to SOUNDS in SETTINGS so I can assign to various functions please?

    when i purchase ringtones and they download directly to the music app on iphone, how can I move them to SOUNDS in SETTINGS so I can assign to various functions please?

    You would have to create the ringtones.
    Google will find several way to do this.
    You cannot buy ready made ringtones from your computer.

  • I have been exporting lightroom webgaleries to my iweb site without any problem.  Suddenly I get the error message "finder can't complete the operation because some data can't be read or written" - error code -36 - thoughts?

    i have been exporting lightroom web galleries to my iweb site without any problem.  Suddenly I get the error message "finder can't complete the operation because some data can't be read or written" - error code -36 - and the move to the sites folder on my idisk fails..... thoughts?

    Try this community: MobileMe on my Mac: MobileMe: Apple Support Communities.
    And you can continue to use iWeb for some time to come. The following will explain:
    It's now confirmed that iWeb and iDVD have been discontinued by Apple. This is evidenced by the fact that new Macs are shipping with iLife 11 installed but without iWeb and iDVD.
    On June 30, 2012 MobileMe will be shutdown. HOWEVER, iWeb will still continue to work but without the following:
    Features No Longer Available Once MobileMe is Discontinued:
    ◼ Password protection
    ◼ Blog and photo comments
    ◼ Blog search
    ◼ Hit counter
    ◼ MobileMe Gallery
    All of these features can be replaced with 3rd party options.
    I found that if I published my site to a folder on my hard drive and then uploaded with a 3rd party FTP client subscriptions to slideshows and the RSS feed were broken.  If I published directly from iWeb to the FPT server those two features continued to work correctly.
    There's another problem and that's with iWeb's popup slideshows.  Once the MMe servers are no longer online the popup slideshow buttons will not display their images.
    Click to view full size
    However, Roddy McKay and I have figured out a way to modify existing sites with those slideshows and iWeb itself so that those images will display as expected once MobileMe servers are gone.  How to is described in this tutorial: #26 - How to Modify iWeb So Popup Slideshows Will Work After MobileMe is Discontinued.
    In addition the iLife suite of applications offered on disc is now a discontinued product and the remaining supported iApps will only be available thru the App Store from now on.
    HOWEVER, the iLife 11 boxed version that is still currently available at the online Apple Store (Store button at the top of the page) and those copies still on the shelves of retailers will include iWeb and iDVD.

Maybe you are looking for

  • How to get photos off my iphone 4s that does not turn on

    i have nearly 2,000 photos on my iphone 4s, but my iphone just stopped working, wont turn on, i just really want the photos off thats all ive tried holding both buttons for ages and still nothing, can someone help me pls

  • Nokia 6220 - GPS,Maps,Navigation Question

    This may be a silly question but I'm a little confused over this I am considering buying a 6220 (SIM free), mainly because it's an 'upgraded' version to my existing 6300. The idea is instead of having a SAT NAV (for the occasional trips to places I'v

  • Word & Excel will not send open Document as an Email Attachment

    I have a user (one of the firm's managing principals), who can no longer Email the currently open document as an attachment from Word or Excel.  The last thing that was installed on her system was Outlook 2013, it is set as the default email software

  • How to make a menu in Canvas?

    I have just succeded to make my first Canvas window. What do I need to make a little menu (still using canvas), like a text with the label "Press me" and when the user press the button, a new form is beeing set? Any tutorials?

  • DBAdapter Merge

    Trying to update a table using DBAdapter and Merge operation. The table has besides other columns creation_date and last_update_date. What is the best way to populate the creation_date and last_update_date to sysdate when inserting a row, and only po