Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 3 of 3

Thread: Table questions

  1. #1
    Join Date
    Aug 2005
    Posts
    51

    Table questions

    Table 1
    Code:
    install_service_table={NMEA_Combiner="ECC NMEA Combiner", GLOBE_Server = "ECC-GLOBE Server", NMEA_logger="ECC NMEA Logger", Log_server = "ECC Log Server", Service_Monitor = "ECC Service Monitor"};
    
    for pack_name,Serv_name in install_service_table do
     result = Dialog.Message("Notice", "Service Name"..Serv_name, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    end
    When this runs the table elements are in this order in the dialog:

    ECC Log Server
    ECC-GLOBE Server
    ECC Service Monitor
    ECC NMEA Logger
    ECC NMEA Combiner

    I am not sure what controls the sort order. It isn't alphabetical nor is it in order of when they were added.

    Table 2
    Code:
    install_service_table={"ECC NMEA Combiner","ECC-GLOBE Server","ECC NMEA Logger","ECC Log Server","ECC Service Monitor"};
    
    for pack_name,Serv_name in install_service_table do
     result = Dialog.Message("Notice", "Service Name"..Serv_name, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    end
    When this runs the table elements are in this order in the dialog:

    ECC NMEA Combiner
    ECC-GLOBE Server
    ECC NMEA Logger
    ECC Log Server
    ECC Service Monitor

    Which is the order they were added to the table. Each is loaded by its array position.

    My question is what controls the order in Table 1?

  2. #2
    Join Date
    Apr 2001
    Location
    Haverhill, Suffolk, UK
    Posts
    360
    Dan,

    I came across this the other day when I was trying to use arrays for similar purpose.

    From the Help File (Tables (Arrays))

    Whoa there—why aren’t the table elements in order? The reason for this is that internally the scripting engine doesn’t store tables as arrays, but in a super-efficient structure known as a hash table. (Don’t worry, I get confused about hash tables too.) The important thing to know is that when you define table elements, they are not necessarily stored in the order that you define or add them, unless you use a numeric array (i.e. a table indexed with numbers from 1 to whatever).
    I suspect this may be the same you are seeing.

    Rgds John

  3. #3
    Join Date
    Aug 2005
    Posts
    51
    Quote Originally Posted by JXBURNS View Post
    Dan,

    I came across this the other day when I was trying to use arrays for similar purpose.

    From the Help File (Tables (Arrays))



    I suspect this may be the same you are seeing.

    Rgds John
    Thanks John.

    I saw that also. My question is how are these ordered in table one. It isn't random. The table one list is always the same in this configureation.

Similar Threads

  1. buttons disappear
    By mgokkaya in forum AutoPlay Media Studio 6.0
    Replies: 5
    Last Post: 04-11-2008, 02:40 PM
  2. prob getting table to combobox
    By Jonas DK in forum AutoPlay Media Studio 6.0
    Replies: 2
    Last Post: 01-05-2007, 04:56 PM
  3. string / table compare
    By gabrielfenwich in forum AutoPlay Media Studio 5.0
    Replies: 5
    Last Post: 01-29-2005, 11:30 PM
  4. Creating a Table of Contents
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 10-03-2003, 11:35 AM
  5. Weird Errors
    By RobbyH in forum AutoPlay Media Studio 4.0
    Replies: 9
    Last Post: 01-30-2003, 04:25 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