|
Kiasyn Apprentice
Joined: 05 Dec 2004 Posts: 196 Location: New Zealand
|
Posted: Wed Nov 15, 2006 6:02 am
CMUD Idea :) |
Named indexes in arrays, like php? :]
|
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Wed Nov 15, 2006 4:29 pm |
I think the data record variables are extremely useful and mimic a lot of the functionality of the named indexes in PHP arrays. I'd just like a function to sort data record variables by key name.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Nov 15, 2006 7:15 pm |
Yeah, this is really already there. Just do stuff like:
Code: |
myarray.myindex = value |
These data record variables are not currently as efficient as the named index arrays in php or perl, but this can be improved in the future without effecting the syntax. Using #LOOPDB allows you to loop through one of these "arrays" much like the foreach in php. Larkin is correct that we probably need more functions to deal with these kind of variables, but that will probably wait till their implementation is a bit more optimized. Right now they are just stored like strings with different control characters separating the keys and values, and this is pretty clumsy sometimes. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Thu Nov 16, 2006 1:52 am |
It'd be really neat if datarecord variables could include support for the @variable.function() syntax as per collections and classes (at least as they are in VB, though I assume Delphi does something similar). It'd be even more super if we could somehow actually build complete objects self-contained in one setting rather than as a grouped class of aliases, functions, variables, and events--but that's getting WAY ahead of ourselves there.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Kiasyn Apprentice
Joined: 05 Dec 2004 Posts: 196 Location: New Zealand
|
Posted: Tue Nov 21, 2006 9:13 am |
ah yes i totally forgot about db keys, thanks! :D
|
|
|
|
|
|