Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2002
    Location
    Just South of Reality
    Posts
    778

    is this an XML bug...?

    There didn't appear to be much in the forum on XML or I just missed it...

    This works fine:
    Code:
    -- Gets the second customer's second phone number.
    customer_phone = XML.GetValue("database/customer:2/phone:2");
    This doesn't work:
    Code:
    -- Gets the second customer's second phone number.
    x=2
    customer_phone = XML.GetValue("database/customer:x/phone:x");
    I am having issues with looping thru XML...the XML indexing doesn't seem to work with anything other than an actual integer...

    any ideas...?

  2. #2
    Join Date
    May 2006
    Posts
    1,443
    your variable X in string form in your second example

    it should be something like this

    Code:
    min = 1; 
    max = 10;
    
      for i = min, max do
         
         customer_phone = XML.GetValue("database/customer:"..i.."/phone:"..i);
         ListBox.AddItem("ListBox1", customer_phone, "");
    
      end

  3. #3
    Join Date
    Jul 2002
    Location
    Just South of Reality
    Posts
    778

    ignore the thread...

    ...just found it.

    customer_phone = XML.GetValue("database/customer:"..x.."/phone:"..x");

    ...and thanks Reteset

    senility is rapidly taking its toll on me...
    Last edited by holtgrewe; 10-28-2009 at 01:52 PM. Reason: edit response

Posting Permissions

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