Freddy1990
02-27-2007, 07:55 PM
Well, I just got a request from someone who obviously needed variants and i thought I might as well post it so the rest of you who don't know can learn about them :)
A variant is a type that can hold all sorts of types, for example, you can put integer values, extendezd values, strings etc... into variants...
Also, if you put for example an integer, string, boolean, etc in it, you can use it in writeln (direct conversion to string).
You can also store types like TPoint or user-created types in it, but (as far as i know) only for storing them, to use them again you'd need to put them back into the original type.
You could for example also store a variant which holds a boolean in an integer.
If the boolean is true the value will be -1 if it's False it'll be 0.
I hope it helps ;)
A variant is a type that can hold all sorts of types, for example, you can put integer values, extendezd values, strings etc... into variants...
Also, if you put for example an integer, string, boolean, etc in it, you can use it in writeln (direct conversion to string).
You can also store types like TPoint or user-created types in it, but (as far as i know) only for storing them, to use them again you'd need to put them back into the original type.
You could for example also store a variant which holds a boolean in an integer.
If the boolean is true the value will be -1 if it's False it'll be 0.
I hope it helps ;)