Sign in to follow this  
Followers 0
singbass

Multi-dimensional array help

3 posts in this topic

I figure this is possible, but I can't get my brain around it. I want to store an array inside the element of another array.

I have a big file of patient info that I will parse. I specifically want name, date of birth and time of birth. I want to get a count of patients born heer for each day of the year for each minute of the day.

I was thinking a 2D array (day) with rows and columns for months and days where each element would then represent a day of the year and within each element of this array would be another 2D array (time) with rows and columns for hour and minute of each day. For now, the data will only be for one year but in the future I may need to store my 2D time arrays inside a 3D array so I can span multiple years.

I can't figure out how to reference the time array inside the day array. Any help or suggestions on another way to go about this would be appreciated.

Share this post


Link to post
Share on other sites



I figure this is possible, but I can't get my brain around it. I want to store an array inside the element of another array.

I have a big file of patient info that I will parse. I specifically want name, date of birth and time of birth. I want to get a count of patients born heer for each day of the year for each minute of the day.

I was thinking a 2D array (day) with rows and columns for months and days where each element would then represent a day of the year and within each element of this array would be another 2D array (time) with rows and columns for hour and minute of each day. For now, the data will only be for one year but in the future I may need to store my 2D time arrays inside a 3D array so I can span multiple years.

I can't figure out how to reference the time array inside the day array. Any help or suggestions on another way to go about this would be appreciated.

It is technically possible to store arrays as elements in other arrays, but usually a bad idea.

Arrays are a run-time object that exists in memory while the script is running. Not a place to store or build up data over time. For the data you are describing it would make much more sense to use a database like SQLite. There are _SQLite* functions already included with AutoIt. SQL Queries will get you the records you want much more easily.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Thanks. I'll give it a try.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0