Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 11 of 11
  1. #1
    Join Date
    Jul 2004
    Posts
    313

    Looking into the XML part of things

    Hi Guys,

    I am looking into using xml in a project but I am totally confused and I have not used AMS for aaaaages.

    Heres what I have

    Code:
    XML.Load("C:\\MyFile.xml");
    fname = XML.GetValue("database/customer id/first_name");

    How do I get fname into a list box?

    Thanks

  2. #2
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    Hi,
    As fname is a string, you can use the ListBox.SetItemData (or SetItemText) action:
    ListBox.SetItemData ("yourListBox",1,fname);

    Yossi

  3. #3
    Join Date
    Jul 2004
    Posts
    313
    Yossi

    Thanks

  4. #4
    Join Date
    Jul 2004
    Posts
    313
    mmm, does not seem to work for me,

    I am using the examples from the help manual too.

    I have also read about a little bug relating to a trailing slash, I tried that but still nothing.

    any ideas?

    On Preload:
    Code:
    XML.Load("C:\\MyFile.xml");
    fname = XML.GetValue("*/customer");

    On Show:
    Code:
    ListBox.SetItemData("yourListBox",1,fname);
    ListBox.SetItemText("yourListBox",1,fname);

  5. #5
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    Try and debug it and see what is the actual value for fname

  6. #6
    Join Date
    Jul 2004
    Posts
    313
    Hi yosik,

    Is there an internal debugger? I cannot find it anywhere

    thanks

  7. #7
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    I use Dialog.Message("Testing", fname) to test values all the time. Throw that in there to see what is returned. Might be that nothing is found at the path/value you specified and it returns nil or a blank string. Cant remember right now which one it is.

    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

  8. #8
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Quote Originally Posted by ianhull View Post
    Hi yosik,

    Is there an internal debugger? I cannot find it anywhere

    thanks
    Edit -> Preferences : [] Show Debug window

    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

  9. #9
    Join Date
    Jul 2004
    Posts
    313
    Debug Output

    Code:
    
    *** LOCATION: Page1 -> On Mouse Move
    [1]: XML.Load("C:\\MyFile.xml");
    TRACE: LastError = 0 ("Success.")
    [2]: fname = XML.GetValue("*/customer");
    TRACE: LastError = 0 ("Success.")
    [3]: ListBox.SetItemData("yourListBox",1,fname);
    TRACE: LastError = 1702 ("Index out of range")
    [4]: ListBox.SetItemText("yourListBox",1,fname);
    TRACE: LastError = 1702 ("Index out of range")

  10. #10
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Try ListBox.AddItem. I believe the SetItemText and SetItemData is for an item that already exists in the listbox.

    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

  11. #11
    Join Date
    Jul 2004
    Posts
    313
    ListBox.AddItem("yourListBox",fname);

    This works great,

    thanks again guys

    much appreciated.

Similar Threads

  1. XML processing
    By bgc in forum AutoPlay Media Studio 6.0
    Replies: 5
    Last Post: 01-04-2007, 07:42 AM
  2. Error inserting XML
    By TJS in forum AutoPlay Media Studio 6.0
    Replies: 6
    Last Post: 06-08-2006, 10:30 AM
  3. XML format
    By TJ_Tigger in forum AutoPlay Media Studio 5.0
    Replies: 6
    Last Post: 10-04-2005, 12:47 PM
  4. Spotlight: XML Actions Plugin
    By Desmond in forum AutoPlay Media Studio 5.0
    Replies: 1
    Last Post: 03-15-2004, 03:56 PM

Posting Permissions

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