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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Quicksilver
Newbie


Joined: 22 May 2008
Posts: 9

PostPosted: Tue Aug 10, 2021 9:37 pm   

"Unsorted" Database variable
 
I'm trying to create a database variable and I'd like the sort order to be the order in which I added the items. I'm not touching the Sort field, which is set to None.

Everything seems fine until I close CMUD and reload, then the variable is sorted in some odd, internal way. Like I said, it seems happy not to touch the sort order until a reload (or actually a copy and paste of the variable will dis-order the items)

No sort should mean NO SORT, as in, don't change the order with which the variable was created.

Am I off base here?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Wed Aug 11, 2021 3:12 am   
 
Uncertain, but entirely possible.
I don't know all the quirks of json variables.
But a normal old string list variable will work as you are expecting, either as a separate variable or in an index key.
_________________
Discord: Shalimarwildcat
Reply with quote
Quicksilver
Newbie


Joined: 22 May 2008
Posts: 9

PostPosted: Wed Aug 11, 2021 4:05 am   
 
shalimar wrote:
But a normal old string list variable will work as you are expecting, either as a separate variable or in an index key.


Thanks for the reply, yeah, I can work around it, just shouldn't have to, imo. /shrug.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Wed Aug 11, 2021 2:42 pm   
 
I agree.
Just the nature of how they are most often used doesn't lend that to being a common issue.
Why does it matter in this scenario?
_________________
Discord: Shalimarwildcat
Reply with quote
Quicksilver
Newbie


Joined: 22 May 2008
Posts: 9

PostPosted: Thu Aug 12, 2021 4:10 am   
 
Just makes things easier, and the time I spent trying to figure out wth is going on.

I mean, if "no sort" doesn't mean original order, why have it at all, just sort it alpha by default, rather than whatever order it wants to put it (it consistently sorted the variable in the same, weird, way).

But I do realize CMUD probably won't have another version, I guess I was just hoping someone might know a trick to make the original order "sticky".
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Thu Aug 12, 2021 4:40 am   
 
Without knowing more about what you are trying to do, I can't offer any suggestions.

I get that you are upset about the way you were trying to code it not working, but that might not even be the best way to get the end result you want.
_________________
Discord: Shalimarwildcat
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion 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