|
The Raven Magician
Joined: 13 Oct 2000 Posts: 463
|
Posted: Fri Aug 17, 2007 5:45 pm
[1.34] GUI ignores %vartype(s,i), clobbers manually set %vartype |
#ALIAS testVartype {
#VAR testVar {a=1|b=Foo}
#ECHO %vartype(testVar)
#CALL %vartype(testVar,5)
#ECHO %vartype(testVar)
}
The output from this alias is close to what you would expect:
2
5
The variable starts as type 2 (expanded string) and gets changed to type 5 (a DB record). BUT... if you actually look at the variable in the GUI, it treats it like an array. The GUI is changing the type to Autotype (0) when you look at the variable, rather than respecting the existing variable type. |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Fri Aug 17, 2007 6:04 pm |
I would assume this is going to be completely recoded for the new variables settings anyway.
|
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
The Raven Magician
Joined: 13 Oct 2000 Posts: 463
|
Posted: Fri Aug 17, 2007 6:06 pm |
I haven't read up on all the changes going into 2.0... I'm just back to using CMud again, so I started posting bugs. I'm quite sure that some of the bugs I post will be outdated or already-reported, but it's better to report a duplicate, than to not report at all. :-)
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Aug 17, 2007 7:06 pm |
The reason it is initially set to "expanded string" is because you used the {value} syntax. The {} braces indicate an expanded string, just like "" indicate a literal string.
The settings editor tries to be a bit smarter. The settings editor actually looks at the data in the variable to determine what kind of editor to show. This is a feature. You want it to show the database editor in this case, and not just the plain text editor. The settings editor displays the correct editor, but resets the variable type to "Auto" to tell the rest of the system that this variable might be more than just an "expanded string".
So, this is all normal and isn't going to change. It's only string lists and database variables that exhibit this behavior, and it actually works the way most people would want it to. If you need to force CMUD to keep that value as a string, then set it to a Literal String type instead. |
|
|
|
The Raven Magician
Joined: 13 Oct 2000 Posts: 463
|
Posted: Fri Aug 17, 2007 7:17 pm |
Is there a way for me to tell the GUI NOT to reinterpret the string? Well... lemme put it a different way.
When I view the variable in the GUI for the first time, it sets the variable type to 0, auto. Then, if I change the type (in the GUI) to type 5, it properly displays the variable as a database record. AND IT REMEMBERS THAT. How can I tell the GUI not to reset type type to 0? How can I set the variable so that the GUI thinks it has already looked at it?
The problem is that setting the variable to type 5 via the GUI is different than setting the variable to type 5 via %vartype(). It shouldn't be different... they should be the same, so that if I manually set a variable with %vartype, the GUI does not clobber my setting when I look at the variable. Can %vartype() be updated so that it it marks the variable to not be Autotyped when I view it?
Edit: typo |
|
|
|
|
|