Log in

View Full Version : Variant?



zeeky111
02-09-2011, 11:18 PM
I'm probably going to be feeling dumb for a week after this.

I'm attempting to use the function
function R_WithdrawItem(TheVar: Variant, Amount: Integer)

In the parameters, what does the variant represent, and how do I use this function in my script?

Zyt3x
02-09-2011, 11:23 PM
Simplified said, a Variant is an integer, extended, boolean and string all at the same time.

A Variant can either be a string, integer, extended or a boolean (+ byte, char, int64 and whatnot, but that's of none importance atm)

When a function requires a variant, it's usually a string or an integer. In your case it looks like it would accept an ID or a name of the item.

Try with the name of the item first, then the ID if that doesn't work.

zeeky111
02-09-2011, 11:55 PM
Thanks. :].
I searched the forums for some form of variant help, and couldn't find any.

Got it, it works for now. Thanks, Zyt3x.

tls
02-09-2011, 11:58 PM
http://villavu.com/forum/showthread.php?t=40661

Nava2
02-10-2011, 01:18 AM
Perhaps reading the documentation in the code too would be nice. :)

tls
02-10-2011, 01:28 AM
Perhaps reading the documentation in the code too would be nice. :)

Uh...I didn't document that part :cartman:

zeeky111
02-10-2011, 01:58 AM
I looked through the code and didn't once find the definition of a variant. :P.

Nava2
02-10-2011, 07:23 AM
I looked through the code and didn't once find the definition of a variant. :P.

Nah, that would not be in there. But what to pass as a parameter should be.. mormonman ;)