Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Kiasyn
Apprentice


Joined: 05 Dec 2004
Posts: 196
Location: New Zealand

PostPosted: Wed Nov 15, 2006 6:02 am   

CMUD Idea :)
 
Named indexes in arrays, like php? :]
_________________
Kiasyn
Owner of Legends of Drazon
Coder on Dark Legacy
Check out Talon, an easy IMC connection.
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: 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.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: 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.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: 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
Reply with quote
Kiasyn
Apprentice


Joined: 05 Dec 2004
Posts: 196
Location: New Zealand

PostPosted: Tue Nov 21, 2006 9:13 am   
 
ah yes i totally forgot about db keys, thanks! :D
_________________
Kiasyn
Owner of Legends of Drazon
Coder on Dark Legacy
Check out Talon, an easy IMC connection.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net