ID:974280
Sep 11 2012, 1:39 pm (Edited by moderator on Sep 11 2012, 1:44 pm)
|
|||||||||||||
| |||||||||||||
issaved is not exactly clear on how it should be used as you can't specify an object to use it on. Every time I have to use it I'm confused by this proc, and I've been around for 8 years. I think this proc confuses a lot of people and could do with some better documentation + examples of code (especially an example of a loop).
|
Sep 11 2012, 1:47 pm
|
|
I don't think there is a bug here but we'll take a look and clarify the docs if needed.
|
IMHO any functionality that is not clear to the end user is something that needs to be addressed. Especially in an application that emphasizes ease-of-use the way BYOND does.
|
I believe it works like initial(), where when you pass a variable to it, it also somehow passes the object used to reference that variable. If I had to guess, I would say it's just a preprocessor macro trick.
mob/verb/Test() Anyways, I miss the newer version of the reference where there were notes to clarify things. :P |
In response to DarkCampainger
|
|
The strange part is how it picks up on the variable itself, rather than the value contained by it.
|
In response to Kaiochao
|
|
Kaiochao wrote:
The strange part is how it picks up on the variable itself, rather than the value contained by it. I recall messing around with something like that. I don't remember exactly what, but I think uh, something relating to vars["var"] - where the variable, not the value would be...picked up? I think time2text works the same way - it checks the variable. I'm not 100%, but I've tried to use my own "time" values, and nothing good came out of it when trying to turn it into a time/date, or I was just doing something wrong, who knows. |
In response to Super Saiyan X
|
|
vars is a simple list that works exactly like all other lists. I don't think you can add/remove an item from it at runtime, but you can definitely dynamically get/set arbitrary variables using strings.
Also, time2text takes a number and a string. Nothing special there. |
I know, Kaiochao. I'm just saying, the thing with the variable being read instead of the value has occurred with the usage of vars[]. vars["x"] should reference the actual value, not the variable.
I know what it takes, gosh. I'm just saying I've ran into issues with using my own time variables. Maybe I just assumed too much about what the procedure does. (time as '0' wouldn't be 12:00, it was like, 20:00 instead?) But, that's unrelated to this, I guess. |
In response to Super Saiyan X
|
|
It works like lists how you can set list associations using square brackets the same way you access them. I see what you mean, though.
var L[] = list(a=2, b=6) |
In response to Stephen001
|
|
That's just what I thought SSX was possibly being confused about.
|
Well, I think it's fair to say that would be a very wrong way to presume it would work. But as he says, this is pretty well unrelated to issaved(), initial() and company.
|
In response to Kaiochao
|
|
Kaiochao wrote:
That's just what I thought SSX was possibly being confused about. I wasn't confused about anything. All I said was I recalled a time where the vars["bleh"] would read the variable - like issaved - instead of the value. It wasn't when assigning it, but something different entirely...but, like I said. Don't remember exactly. |