Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2004
    Posts
    18

    Peekaboo! some Questions for arrays and tables

    Hi there,
    1. How can I define multidimension arrays?
    2. How can I define an array like the SQLite Plugin Command SQLite.QueryToTable, where I can access the data through a table in another table?
    Is there any Plugin or Workaround to show a table in AMS with more than one column? I don't want to create an HTML Page!

    Hope you understand my questions and thanks a lot in advance. Greez Tjin

  2. #2
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Quote Originally Posted by Sie Tjin Kian
    Hi there,
    1. How can I define multidimension arrays?
    I like to think of multidimensional arrays as tables within tables. When you define a row in a table rather than assigning a string or numerical value, you can define it as a table. Like this

    Code:
    mdArray = {};
    mdArray[1] = {name = "Worm", location = "Michigan"};
    mdArray[2] = {name = "JimS", location = "Oregon"};
    mdArray[3] = {name = "yosik", location = "Israel"};
    mdArray[4] = {name = "Derek", location = "Bristol"};
    mdArray[5] = {name = "Tigg", location = "Iowa"};
    
    -- the information can then be accessed by doing this.
    for i,v in mdArray do
         sName = mdArray[i]["name"];
         sLoc = mdArray[i]["location"];
         Dialog.Message("Information", sName .. " is located in ".. sLoc);
    end
    Quote Originally Posted by Sie Tjin Kian

    2. How can I define an array like the SQLite Plugin Command SQLite.QueryToTable, where I can access the data through a table in another table?
    see the above on creating a table within a table.

    Quote Originally Posted by Sie Tjin Kian
    Is there any Plugin or Workaround to show a table in AMS with more than one column? I don't want to create an HTML Page!

    Hope you understand my questions and thanks a lot in advance. Greez Tjin
    There is not a plugin at this time that allows you to show the contents of an array within AMS. A HTML table seems to work very well at this time, you could create a tabular or csv text file and then put the contents into a paragraph object. I have also used multiple List Boxes to create a grid like area on the screen to populate data from a table. Not the cleanest or easiest thing to do but it works well.

    Oh, as far as a plugin, you could store data in an XML file and then potentially open that file in Excel or a csv file for that matter and use LuaCOM or File.Run to open in Excel as well.

    HTH 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

  3. #3
    Join Date
    Dec 2004
    Posts
    18
    Hi TJ_Tigger,
    thats exactly what I want, great - thanks!
    Code:
    mdArray = {};
    mdArray[1] = {name = "Worm", location = "Michigan"};
    mdArray[2] = {name = "JimS", location = "Oregon"};
    mdArray[3] = {name = "yosik", location = "Israel"};
    mdArray[4] = {name = "Derek", location = "Bristol"};
    mdArray[5] = {name = "Tigg", location = "Iowa"};
    
    -- the information can then be accessed by doing this.
    for i,v in mdArray do
         sName = mdArray[i]["name"];
         sLoc = mdArray[i]["location"];
         Dialog.Message("Information", sName .. " is located in ".. sLoc);
    end
    I have also tried to use listboxes for tables, but its very complicated! Maybe this will be a feature in future? I need to access the table elements and so I can't use HTML pages.
    Thanks a lot, Tjin

  4. #4
    Join Date
    Jan 2008
    Location
    Ufa, Russia
    Posts
    128

    CSV Parser

    Somewhere in this forum I've read that a parser for CSV (comma-separated) tables would be a boon for the DataGrid Plugin. So I quickly made this tool that is able to export a CSV file into an AMS double-dimensioned array (rows / cols).

    Features:
    • import CSV file and read into AMS string
    • raw CSV preview
    • parser function that returns a double array (rows by cols), number of rows and columns
    • LuaCom feature that exports the output result into Microsoft Excel (opens up Excel and fills in the data)

    CSV Parser.apz

Similar Threads

  1. I'm baaaaaaack with SQL questions!
    By CelticDragon in forum AutoPlay Media Studio 5.0
    Replies: 1
    Last Post: 04-08-2005, 12:42 PM
  2. Tables, CSV (Excel) and Database Reports
    By csd214 in forum AutoPlay Media Studio 5.0
    Replies: 1
    Last Post: 04-27-2004, 12:08 PM
  3. Using Tables and Memory resources handling
    By SUF6NEWBIE in forum AutoPlay Media Studio 5.0
    Replies: 3
    Last Post: 04-19-2004, 12:11 PM
  4. Always confusing with tables
    By arnaud in forum AutoPlay Media Studio 5.0
    Replies: 3
    Last Post: 01-25-2004, 06:33 PM
  5. Working with Tables and Files
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 12-23-2003, 08:22 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