JaedenRuiner
Well-known member
- Joined
- Aug 13, 2007
- Messages
- 340
- Programming Experience
- 10+
Is there a way to write an extension that handle Implicit type conversions of objects, but the same as Structures/Classes can be written with Operators that handle the multi-various operations that could be applied to an object.
See, I know people will disagree, but three classes should never be so painstaking to deal with:
Char, Byte, String.
A char and string are interchangeable, save for the length, even Java knows that. You can't set a Char to String, because a Char is a Simple type, unsigned 8 bit value, where a string is technically a reference type pointing to multiple bytes of chars (whether they be multi-byte chars or single byte doesn't matter). It is a Byte that happens be referenced via the ascii chart as opposed to straight up numerics. Strings are multiple chars.
Array of Char() = A STRING, and the conversion should be automatic. I can't even do a CType(Char, Byte) to get the value.
C, C++, Delphi, Java, all can do these simple things, but VB can't...so naturally I want to hack it. *chuckle*
I'm already writing Char() array extensions that will handle some of it, but I was wondering if I could some how, "hard code" certain operations like how I can write a Narrowing/Widening conversion operator CType() for a Structure or Class.
Thanks
See, I know people will disagree, but three classes should never be so painstaking to deal with:
Char, Byte, String.
A char and string are interchangeable, save for the length, even Java knows that. You can't set a Char to String, because a Char is a Simple type, unsigned 8 bit value, where a string is technically a reference type pointing to multiple bytes of chars (whether they be multi-byte chars or single byte doesn't matter). It is a Byte that happens be referenced via the ascii chart as opposed to straight up numerics. Strings are multiple chars.
Array of Char() = A STRING, and the conversion should be automatic. I can't even do a CType(Char, Byte) to get the value.
C, C++, Delphi, Java, all can do these simple things, but VB can't...so naturally I want to hack it. *chuckle*
I'm already writing Char() array extensions that will handle some of it, but I was wondering if I could some how, "hard code" certain operations like how I can write a Narrowing/Widening conversion operator CType() for a Structure or Class.
Thanks