This project aim is to extend Visual Basic 6.0 built-in types (like Integer, Long, String and etc.) in order to make work with it more convinient ("one-liner" style if needed) and support extended properties/methods on that basic types.
Classes:
- ArrayEx
- ByteEx
- CurrencyEx
- IntegerEx
- LongEx
- DoubleEx
- StringEx
Sample usage:
#1
Dim s As New StringEx
s = "Hello"
MsgBox s.Clone.Parse(" Hello VBForums ").TrimL.Insert(0, "'").Concat("!!!'").Upper 'produces 'HELLO VBFORUMS !!!'
MsgBox s 'produces Hello since Clone was used in first msgbox
#2
Dim s As New StringEx
MsgBox s.Parse("343 18 44").Split(" ", , , vbLong).Value(0) 'produces 343 - first item of single-dimensioned LONG type array
Notes:
- Each class has default property Value that is used to assign/read value of appropriate basic VB 6.0 type;
- Each class has Clone method that produces a new instance of class with same value;
- If class function returns same type as class has - that means NO new instanse created (except Clone method) and call modifies initial value assigned at first use of class Value property;
Most valuable features:
- Aim on performance;
- ArrayEx class reports of dimensions, elements size and allows to get pointer of any type of basic array assigned via Value property;
- StringEx class has powerfull Parse method that can get byte arrays and produce utf-16 native VB6 string (f.e. from ansi, utf-8 with/without bom, utf-16 with/without bom/LE/BE text file);
- StringEx class works with dynamically buffered string, so "Concat" and other methods are very usefull within loops (f.e. 'This Is My New Test String' concatenation of 50000 iterations took ~0.37 sec against same VB6 concatenation taking ~23 sec);
- StringEx class has additional methods like Duplicate, Insert & Remove and etc as well as native to a developer Trim, TrimL/R, Replace, Left, Right and etc methods;
- StringEx class exposes a string pointer so you can manipulate it with your own RtlMoveMemory-based routines;
- ByteEx/IntegerEx/LongEx/DoubleEx classes each have Parse method capable to extract numbers from Variant string as well as get value from numeric types directly without overflow;
List of revisions:
1.2.0 (06-Nov-2016)
ArrayEx: extended functionality;
Numeric classes: add new conversion properties + fixes for Parse methods.
1.1.0 (02-Nov-2016)
StringEx: added Compare, PadLeft, PadRight and Split (supports output type specify) functions.
CurrencyEx: base class added
Fixed Double type min/max constants accuracy
1.0.0 (29-Oct-2016) (with updates)
Classes:
- ArrayEx
- ByteEx
- CurrencyEx
- IntegerEx
- LongEx
- DoubleEx
- StringEx
Sample usage:
#1
Dim s As New StringEx
s = "Hello"
MsgBox s.Clone.Parse(" Hello VBForums ").TrimL.Insert(0, "'").Concat("!!!'").Upper 'produces 'HELLO VBFORUMS !!!'
MsgBox s 'produces Hello since Clone was used in first msgbox
#2
Dim s As New StringEx
MsgBox s.Parse("343 18 44").Split(" ", , , vbLong).Value(0) 'produces 343 - first item of single-dimensioned LONG type array
Notes:
- Each class has default property Value that is used to assign/read value of appropriate basic VB 6.0 type;
- Each class has Clone method that produces a new instance of class with same value;
- If class function returns same type as class has - that means NO new instanse created (except Clone method) and call modifies initial value assigned at first use of class Value property;
Most valuable features:
- Aim on performance;
- ArrayEx class reports of dimensions, elements size and allows to get pointer of any type of basic array assigned via Value property;
- StringEx class has powerfull Parse method that can get byte arrays and produce utf-16 native VB6 string (f.e. from ansi, utf-8 with/without bom, utf-16 with/without bom/LE/BE text file);
- StringEx class works with dynamically buffered string, so "Concat" and other methods are very usefull within loops (f.e. 'This Is My New Test String' concatenation of 50000 iterations took ~0.37 sec against same VB6 concatenation taking ~23 sec);
- StringEx class has additional methods like Duplicate, Insert & Remove and etc as well as native to a developer Trim, TrimL/R, Replace, Left, Right and etc methods;
- StringEx class exposes a string pointer so you can manipulate it with your own RtlMoveMemory-based routines;
- ByteEx/IntegerEx/LongEx/DoubleEx classes each have Parse method capable to extract numbers from Variant string as well as get value from numeric types directly without overflow;
List of revisions:
1.2.0 (06-Nov-2016)
ArrayEx: extended functionality;
Numeric classes: add new conversion properties + fixes for Parse methods.
1.1.0 (02-Nov-2016)
StringEx: added Compare, PadLeft, PadRight and Split (supports output type specify) functions.
CurrencyEx: base class added
Fixed Double type min/max constants accuracy
1.0.0 (29-Oct-2016) (with updates)