Suggestion: record data type

New releases and general discussions.

Post » Thu Mar 18, 2010 8:38 pm

If you need more than a number/a string stored inside a hash table or an array, you have to use multiple arrays/tables. That is quite slow on the machine, and on the coding process.

Using a record structure where you can hold multiple strings/numbers and add them to an array will solve a lot of future trouble and can take Construct to a whole new level.

For any serious projects you will need some kind of database, using a record object and an array the problem is somehow solved.

Thank you.
B
3
G
2
Posts: 14
Reputation: 703

Post » Thu Mar 18, 2010 8:51 pm

I take it you didn't stumble upon the S plugin yet?

[url:3sjdxmwu]http://www.scirra.com/forum/viewtopic.php?f=2&t=4791[/url:3sjdxmwu]

Also you could store more information in a single string if you use delimiters. Not saying that it's handy in most situations, just saying... :wink:
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Fri Mar 19, 2010 12:55 am

Wow, that is a great add-on.

Testing it now.
B
3
G
2
Posts: 14
Reputation: 703

Post » Fri Mar 19, 2010 10:39 am

You can always use a 2- or 3-dimensional array to store additional data, too.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Fri Mar 19, 2010 10:56 am

Or use Python data structures. I'm going to do so for my next project.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Fri Mar 19, 2010 11:15 pm

[quote="Cristi":x1p001wd]If you need more than a number/a string stored inside a hash table or an array, you have to use multiple arrays/tables. That is quite slow on the machine, and on the coding process.

Using a record structure where you can hold multiple strings/numbers and add them to an array will solve a lot of future trouble and can take Construct to a whole new level.

For any serious projects you will need some kind of database, using a record object and an array the problem is somehow solved.

Thank you.[/quote:x1p001wd]
I disagree with "For any serious projects" because that's not true. Also, what do you mean you'd need multiple arrays or tables? Arrays can hold as many numbers or strings as you want...

I don't understand what you want or how you plan to use it...
B
2
S
2
G
2
Posts: 372
Reputation: 1,794


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 4 guests