Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 11 of 11
  1. #1
    Join Date
    Mar 2007
    Posts
    7

    Problem with loading objects and xml

    I have searched through the forums but have not been able to find a solution. It seems whenever I load info from an external file into my project it then becomes impossible to load from another.
    eg:

    Code:
    XML.Load("MyXML.xml");
    Image.Load("Image1",AnImage);
    XML.InsertXML("node","some info"); --doesn't work with this line removed either
    XML.Save("MyXML.xml");
    This produces the following error--> TRACE: LastError = 37001 ("Error saving XML file.")
    I stripped back my code until I got to the equivilant of the above block so I am pretty sure it is the fact that I am loading one object after the other and it is not loving it. I have had the same problem reading INI files as well. In one instance I was able to work around by restarting my program but that isn't applicable for all situations.
    I originally ran in to this problem using AMS 6.0 but didn't post about it because I wanted to wait and see if it had been resolved in AMS 7.0. Any help on this one would be really appreciated. Am I just missing something?

    note: Not sure if I have this in the right place so if someone could move this if it is in the wrong place that would be awesome.

  2. #2
    Join Date
    Nov 2006
    Location
    Quebec, Canada.
    Posts
    432
    Hello!

    First, welcome to the forums Second, you're in the right place so don't worry, someone should be able to help you
    (On my part, I'm getting tired and I'll probably fall asleep on my desk in the following minutes, so I'm better end this post now )

    Regards,
    FoxLeader

  3. #3
    Join Date
    Dec 2007
    Location
    Missouri, United States
    Posts
    476
    Well 1 problem I see is that your filepath is incorrect. But I also had a problem with inserting.

    Here is the code I used. which works it inserts the string data 'test' to the element NodeInfo located under the element called Node.

    Code:
    Image.Load("Image1", "AutoPlay\\Images\\630A01257.jpg");
    XML.Load("AutoPlay\\Docs\\my.xml");
    XML.SetValue("Node/NodeInfo", "test", false);
    XML.Save("AutoPlay\\Docs\\myFile.xml");
    SetValue allows you to change the data for a element

    hope this helps you.
    Last edited by TimeSurfer; 01-26-2008 at 02:39 AM.

  4. #4
    Join Date
    Mar 2007
    Posts
    7
    The details i put in were just filler and not accurate but i'll give that one a try. But it is 1:30am here so not right now

  5. #5
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Another thing to pay attention to is whether or not you have permissions to write to that directory. Is this running on XP or a Vista machine. Have you tried to write to a temp directory to see if you can srite the file at all?

    Tigg
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  6. #6
    Join Date
    Mar 2007
    Posts
    7
    The directory can be written to. The actions themselves are not actually a problem when handled one at a time. It is just when you put them tgether they no longer work. For example one way to get around it is to have your prgram restart after doing one action before continuing on to the next. But that is hardly an ideal solution unfortunatly. :/

  7. #7
    Join Date
    Mar 2007
    Posts
    7
    Ok doke then. In AMS 7 I am able to get an image to load to an image object then save an xml file no problems. Now my problem is when I try to allow the user to select an image to load using a Dialog.FileBrowse option. Anyone else run in to this and/or have a solution?

  8. #8
    Join Date
    Mar 2007
    Posts
    7
    Nevermind. It was just me disregarding the need for "_SourceFolder" in my file paths. Sorry for all the trouble folks and thanks for the help above.

  9. #9
    Join Date
    Dec 2007
    Posts
    7
    I am having the same problem. Can you post a sample of the code that fixed the original XML issue? Thanks.

  10. #10
    Join Date
    Dec 2007
    Location
    Missouri, United States
    Posts
    476
    garagestudios,
    Post the code where problem is and I will help you fix it.

  11. #11
    Join Date
    Mar 2007
    Posts
    7
    Quote Originally Posted by garagestudios View Post
    I am having the same problem. Can you post a sample of the code that fixed the original XML issue? Thanks.
    My problem was I was treating the app too simply (and in a lazy way). So

    XML.Save("\\AutoPlay\\myxml.xml")
    became
    XML.Save(_SourceFolder .."\\AutoPlay\\myxml.xml")
    and the same goes for loading images etc. If thats not your problem then maybe I can compare my code to yours to see where we both went wrong because this problem drove me batty for quite a while

Similar Threads

  1. XML issue, help please.
    By Animl in forum AutoPlay Media Studio 6.0
    Replies: 4
    Last Post: 12-27-2006, 09:54 PM
  2. Example: Multiple Choice XML Quiz
    By Brett in forum AutoPlay Media Studio 7.5 Examples
    Replies: 0
    Last Post: 09-15-2005, 10:55 AM
  3. INFO: Tips for Debugging Action Lists in AutoPlay Media Studio 4.0
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-03-2002, 08:38 AM

Posting Permissions

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