Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004
    Posts
    47

    Assigning table fields to variables?

    Hey gang!

    Looking for another suggestion... using the DelimitedStringToTable function, what is the best way to take the first row (or header) of a column and assign the content as a variable name?

    Here is what I mean:

    I need to process tables that always contain the same header fields (ie item1,item2,item3,etc.) but they are not always in the same order or position within the table (ie item2,item1,item3).

    Table #1:
    item1,item2,item3,item4
    bread,milk,eggs,cheese
    red,green,blue,yellow


    Table #2:
    item2,item1,item4,item3
    milk,bread,cheese,eggs
    green,red,yellow,blue


    Both would generate the following:
    item1 = bread
    item2 = milk
    item3 = eggs
    item4 = cheese

    item1 = red
    item2 = green
    item3 = blue
    item4 = yellow


    What is the best way to read that first row of a table and assign the contents to a variable that I can use through the rest of a for-in-do loop?

    I hope that makes sense.

    Thanks gang!
    - Hey Captain, we hooked up Data to the internet... Wanna see what he can do?

  2. #2
    Join Date
    Apr 2004
    Posts
    47
    Was wondering why no one had replied with suggestions and then I re-read my post and I see that my thoughts ran together and kinda mucked thins up...

    I need help with tables... Not the DelimitedStringToTable function. I used that to populate the tables. Sorry for the confusion.


    Anyway, what I really need is a way to take the header/first row of a table and assign the contents within each item as the variable name.

    I need to process tables that always contain the same header fields (ie item1,item2,item3,etc.) but they are not always in the same order or position within the table (ie item2,item1,item3).

    Again, sorry about the confusion!

    You guys have always been a great help!
    - Hey Captain, we hooked up Data to the internet... Wanna see what he can do?

Similar Threads

  1. set environment variables
    By Adam in forum Setup Factory 8.0 FAQ
    Replies: 0
    Last Post: 04-28-2008, 11:56 AM
  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. Variables from more than one SQLite table
    By embine in forum AutoPlay Media Studio 5.0
    Replies: 2
    Last Post: 01-16-2005, 05:43 PM
  4. Multiplying variables from edit fields.
    By kraigyb in forum AutoPlay Media Studio 4.0
    Replies: 3
    Last Post: 07-23-2003, 10:04 AM
  5. INFO: Setting Environment Variables
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-10-2002, 12:07 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