Jump to content

ChrisEnn

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by ChrisEnn

  1. Ok, I'll do that. Thanks for your quick reply.
  2. Another newbie question. Using trancexx's solution above, how can I retrieve one of the sub-arrays. This works : Local $vVar = $aStructures[0][2][0] ; => "parameter" but this doesn't : Local $aArray = $aStructures[0][2] ; => ["parameter", "value", "comments"] Instead of retrieving the subarray, I get "Array variable has incorrect number of subscripts or subscript dimension range exceeded." How can I retrieve a sub-array in one go, to then pass it as a parameter to a function ? Thanks for your help.
  3. @InonuTaishou: Your reply is interesting too, my initial reply about JSON was for my data files, but I could indeed use this for my structure array. I'll go with trancess's idea for now, as it seems easier to implement.
  4. Thanks for your answers. I'd thought of using JSON rather than CSV, and haven't yet made a definite decision on what format to use, but my existing files are CSV from Excel (I'm porting an existing Excel-VBA app to a standalone executable), so initially it just seemed easier to use _FileReadToArray and _FileWriteFromArray. @trancexx: that seems exactly what I want, I'll use your solution for now, many thanks. Chris
  5. Hi, This is my first post here. I've searched through the help and these forums and haven't found what I'm looking for. Although I have quite a bit of experience in programming, it's all quite a long time ago (COBOL and dBase/Clipper), and this is my first attempt to write something quite complex using AutoIt. I'm writing an app that reads a single CSV file and then splits it into a number of separate arrays based on the sections in the original file. I then display each of the individual arrays in a ListView control. In order to standardize my code I would like to declare the structure that each array/listview will have, by creating a structure array that contains the following elements: - section name, - number of columns, - an array with the column headers, - an array with the column widths The last two sub-arrays will have a variable number of entries, equal to the second value, the number of columns. Unfortunately, I can't get this to work, I keep getting syntax errors. This is my structure array at present (note that the widths are just placeholders at present) : Global $aStructures[10][4] = [_ ["params", 3, ["parameter", "value", "comments"], [110, 150, 450] ], _ ["notes", 1, ["note"], [500] ], _ ["sizes", 8, ["name", "width", "height", "blockwidth", "blockheight", "hgridsize", "vgridsize", "comments"], [10, 10, 10, 10, 10, 10, 10, 10] ], _ ["templates", 2, ["name", "comments"], [10, 10] ], _ ["elements", 10, ["template", "name", "nature", "frontback", "left", "top", "width", "height", "font", "size"], [10, 10, 10, 10, 10, 10, 10, 10 10, 10] ], _ ["schemes", 4, ["name", "frontbg", "backbg", "comments"], [10, 10, 10, 10] ], _ ["elementcolours", 7, ["scheme", "element", "fg", "bg", "bg2", "gradtype", "gradval"], [10, 10, 10, 10, 10, 10, 10] ], _ ["colours", 7, ["name", "r", "g", "b", "rgb", "hex", "sample"], [10, 10, 10, 10, 10, 10, 10] ], _ ["sheets", 2, ["name", "comments"], [10, 10] ], _ ["items", 10, ["sheet", "size", "template", "scheme", "qty", "f1", "f2", "f3", "f4", "f5"], [10, 10, 10, 10, 10, 10, 10, 10, 10, 10] ] _ ] So, two questions. 1/ Are such arrays allowed, with a variable number of dimensions ? 2/ If so, what am I doing wrong in the above code ? Any help would be welcome. Chris
×
×
  • Create New...