Page 1 of 1

Help Getting and Setting Propertys in Accounts

Posted: Wed Oct 29, 2008 12:28 pm
by Shirkit
Hello.

I'm trying to create New Propertys and Get some of them, but I don't know why I'm not able to do such thing.

Code: Select all

use uo;
use os;

program dildo(cmd)

var eita,name;
	cmd := cmd;
	eita := FindAccount("admin");
	name := eita.GetProp("Name");
	eita.SetProp("Coisa", 1);
	print("Name: "+ eita.GetProp("Name"));
	print("Coisa: "+ eita.GetProp("Coisa"));
	return 1;

endprogram
Why I'm not able to get the Account Name? It Returns "Property Not Found". Can someone help me?

Re: Help Getting and Setting Propertys in Accounts

Posted: Wed Oct 29, 2008 2:15 pm
by CWO

Code: Select all

use uo;
use os;

program dildo(cmd)

var eita,name;
   cmd := cmd;
   eita := FindAccount("admin");
   name := eita.name;
   print("Name: "+ name);
   return 1;
endprogram
The account name is a member of the account object, not a prop. So unless you set this prop to all of your accounts in your scripts yourself, you're much better off just using the account.name instead of account.getprop().

Re: Help Getting and Setting Propertys in Accounts

Posted: Wed Oct 29, 2008 4:28 pm
by Shirkit
Yeah, you're absolutly right =D And it worked on my other codes, thanks! ^^