-
Oct 29th, 2016, 05:49 AM
#1
Thread Starter
Lively Member
VB6 Built-in types extension library (VBTypes)
Project sources are now located at BitBucket (https://bitbucket.org/hwoarang84/vbtypes/src/main/). See all related links at the bottom of the thread.
This project extends Visual Basic 6.0 built-in data types by wrapping basic types into appropriate classes with lots of powerful functionality. You can work with types in much more convinient way (inline if needed), perform effective conversions, checks, transformations and take advantage from using other built-in features.
CLASSES:
- ArrayEx
- BooleanEx
- ByteEx
- CurrencyEx
- DateTimeEx
- DecimalEx
- IntegerEx
- ListEx
- LongEx
- DoubleEx
- SingleEx
- StringEx
DOCUMENTATION:
VBTypes Manual (PDF format)
WIKI | HISTORY
SUBMODULES:
- git submodule update --progress --init --force --remote -- "Ext/vbCore"
TESTING:
https://bitbucket.org/hwoarang84/vbt...i/Installation
LATEST VERSION:
https://bitbucket.org/hwoarang84/vbtypes/get/main.zip
LICENSE AGREEMENTS:
This software is provided 'as-is', without any express or implied warranty. In no event will the author be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Last edited by hwoarang; Aug 10th, 2021 at 10:46 AM.
-
Oct 29th, 2016, 06:27 AM
#2
Lively Member
Re: VB6 Build-in types extension library (FTypes)
Nothing in the zip except the Dll.
-
Oct 29th, 2016, 06:54 AM
#3
Thread Starter
Lively Member
Re: VB6 Build-in types extension library (FTypes)
Originally Posted by VBClassic04
Nothing in the zip except the Dll.
My apologies. Corrected now.
-
Oct 29th, 2016, 08:02 AM
#4
Thread Starter
Lively Member
Re: VB6 Build-in types extension library (FTypes)
Attachtment updated:
- New ByteEx class added;
- StringEx: new functions added
- Minor fixes and improvements
-
Oct 31st, 2016, 02:39 AM
#5
Fanatic Member
Re: VB6 Build-in types extension library (FTypes)
-
Oct 31st, 2016, 09:05 AM
#6
Thread Starter
Lively Member
Re: VB6 Build-in types extension library (FTypes)
Originally Posted by xxdoc123
good ider ...
Hopefully it will help people to write dayly routines concerning types "vice-versa" faster and increase code readability. I started to use it within my current project also. At least at start I eliminated lots of code lines and optimized some loops for strings.
After some days a new version of FTypes will be available - with powerfull ArrayEx class
-
Oct 31st, 2016, 12:01 PM
#7
Hyperactive Member
Re: VB6 Build-in types extension library (FTypes)
Great, keep it up!
I have some suggestions, though. Can you make a support for Currency type of the variable, later extending that on its Decimal subtype (which is poorly supported by native numeric functions in VBA/6)? Also, it would be great if StringEx can be used for numerical operations too, i.e. for storing very big numbers (for which there's no possibility to fit them even into Currency) and doing calculations with them (addition, subtraction, division, multiplication).
P.S. A word in the title is a bit wrong spelled - it should write "built-in".
Last edited by MikiSoft; Oct 31st, 2016 at 08:27 PM.
-
Oct 31st, 2016, 01:02 PM
#8
Thread Starter
Lively Member
Re: VB6 Build-in types extension library (FTypes)
Originally Posted by MikiSoft
Great, keep it up!
I have some suggestions, though. Can you make a support for Currency type of the variable, later extending that on its Decimal subtype (which is poorly supported by native numeric functions in VBA/6)? Also, it would be great if StringEx can be used for numerical operations too, i.e. for storing very big numbers (for which there's no possibility to fit them even into Currency) and doing calculations with them (addition, subtraction, division, multiplication)?
P.S. A word in the title is a bit wrong spelled - it should write "buil t-in".
Hi ) Thank you for your ideas - i will try to include this features after I will handle ArrayEx functionality (now it is can only bring info about array - almost nothing more). Also I will include a base of Currency type in next version (+ Single type).
P.S. since i'm not a native english speaker - sorry for mistake in topic header
-
Oct 31st, 2016, 08:29 PM
#9
Hyperactive Member
Re: VB6 Built-in types extension library (FTypes)
No problem, I'm also not native English speaker.
I'm thinking of joining all familiar non-float variable types (Byte, Integer, Long...) into one - Number, and on the other side all float types into Float, or even both combined into only one - would be also an good idea. So, you would just have to pass a number (either in String or Variant form) to it/them and the parsing routine "automagically" will decide in which type of variable to store it.
Last edited by MikiSoft; Oct 31st, 2016 at 08:41 PM.
-
Nov 1st, 2016, 12:43 AM
#10
Thread Starter
Lively Member
Re: VB6 Built-in types extension library (FTypes)
I would say that for some particular purpose that could be good idea, but not for FTypes. The reason is that a GOD object is not good from architectual point of view and also from performance side. I can say 100% is that FType library will follow strong type model as much as possible. At least for now numeric types have Parse & convert methods that can be used.
But as next steps I can think of common interface to be able to add some kind of additional Numeric class that can parse a value and return needed type.
-
Nov 2nd, 2016, 01:04 AM
#11
Thread Starter
Lively Member
Re: VB6 Built-in types extension library (FTypes)
Attachment updated:
Ftype 1.1.0 (see topic header for details)
Last edited by hwoarang; Nov 30th, 2016 at 01:42 PM.
-
Nov 6th, 2016, 10:03 AM
#12
Thread Starter
Lively Member
Re: VB6 Built-in types extension library (FTypes)
Attachment updated:
Ftype 1.3.0 (see topic header for details). Lots of work was done with ArrayEx ... and new methods are to be added soon too.
Last edited by hwoarang; Nov 30th, 2016 at 01:42 PM.
-
Nov 30th, 2016, 01:41 PM
#13
Thread Starter
Lively Member
Re: VB6 Built-in types extension library (FTypes)
Attachment updated:
FTypes 1.4.0 (see topic header for details). There is now a possibility to work with decimal numbers and achieve high precision.
-
Dec 4th, 2016, 11:34 AM
#14
Thread Starter
Lively Member
Re: VB6 Built-in types extension library (FTypes)
Attachment updated:
FTypes 1.4.1 (see topic header for details). Documentation included.
-
Dec 5th, 2016, 01:46 PM
#15
Thread Starter
Lively Member
Re: VB6 Built-in types extension library (FTypes)
Attachment updated:
FTypes 1.4.2 (see topic header for details).
-
Dec 7th, 2016, 03:44 PM
#16
Thread Starter
Lively Member
Re: VB6 Built-in types extension library (FTypes)
Attachment updated:
FTypes 1.4.3 (see topic header for details). Lots of fixes for ArrayEx class - now it is stable and usable !
-
Dec 10th, 2016, 01:00 AM
#17
Lively Member
Re: VB6 Built-in types extension library (FTypes)
Lovely. I will try this out.
-
Feb 11th, 2017, 02:58 AM
#18
Thread Starter
Lively Member
Re: VB6 Built-in types extension library (FTypes)
Attachment updated:
FTypes 1.5.4 (see topic header for details).
Last edited by hwoarang; Feb 18th, 2017 at 02:55 PM.
-
Feb 11th, 2017, 12:48 PM
#19
Re: VB6 Built-in types extension library (FTypes)
hwoarang,
This is all an interesting idea, but here's a problem I just don't think you're going to overcome.
Example #1:
Code:
Option Explicit
Private Sub Form_Load()
Dim lIndex As Long
Dim nStart As Single
Dim nEnd As Single
Dim lToIncrement As Long
nStart = Timer
For lIndex = 1 To 10000000
lToIncrement = lToIncrement + 1
Next lIndex
nEnd = Timer
MsgBox nEnd - nStart
Debug.Print nEnd - nStart
Unload Me
End Sub
And the output (seconds to execute):
And then, we use your stuff, as shown in how lToIncrement is declared. I even initialized it to remove the overhead of initially instantiating the COM object from the timing.
Code:
Option Explicit
Private Sub Form_Load()
Dim lIndex As Long
Dim nStart As Single
Dim nEnd As Single
Dim lToIncrement As LongEx
Set lToIncrement = New LongEx
lToIncrement = -1
lToIncrement = 0
nStart = Timer
For lIndex = 1 To 10000000
lToIncrement = lToIncrement + 1
Next lIndex
nEnd = Timer
MsgBox nEnd - nStart
Debug.Print nEnd - nStart
Unload Me
End Sub
This time, our output is (seconds):
This is over a 16 times reduction in performance. In most situations, this type of performance hit just isn't going to be acceptable.
I suppose there are specific situations where "enhanced" types may be useful, but one should be aware of this rather dramatic performance hit when using these.
Just as an FYI, when using the native types, they operate rather directly with memory and the CPU. However, when using a class, you must navigate through the class addressing everytime you use one of its properties (even if it's the default property). There's just no way around this. And the above is even using early-binding.
If we were to use late-binding (such as using 'As Variant' or 'As Object' in our declaration), things would even get another order of magnitude worse, as follows:
Code:
Option Explicit
Private Sub Form_Load()
Dim lIndex As Long
Dim nStart As Single
Dim nEnd As Single
Dim lToIncrement As Object
Set lToIncrement = New LongEx
lToIncrement = -1
lToIncrement = 0
nStart = Timer
For lIndex = 1 To 10000000
lToIncrement = lToIncrement + 1
Next lIndex
nEnd = Timer
MsgBox nEnd - nStart
Debug.Print nEnd - nStart
Unload Me
End Sub
This time, the output is (seconds):
... over a 175 times decrease in performance, entirely unacceptable.
Again, a nice idea, but certainly not viable for a complete replacement for the built-in types.
Best Regards,
Elroy
Last edited by Elroy; Feb 11th, 2017 at 01:03 PM.
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
-
Feb 11th, 2017, 01:12 PM
#20
Thread Starter
Lively Member
Re: VB6 Built-in types extension library (FTypes)
Hi Elroy.
The code you've posted has nothing common with the idea of FTypes - I'm sorry. Moreover, your sample is sensless there. Because for anyone who is about to use Ftypes like this - the will always be a performance leaks (i'm also will not speak about late binding ...). The idea is to make less code lines when for example .. you need to convert Long to Integer and then get high word ... anything that Ftypes support - doesn't matter. The performance is not about to be discussed for people like me and you - guess who knows what are things about in VB6.
But .. for your particular case I just did a Sub for incrementing that acts less than 0.5 of a second.
If you want a performance increase - there is a StringEx Concat and rest methods that are much faster than pure VB string opertions. Guess you looked at code already and there is no need to comment.
Anyway, thatnk you for your post. At least I will add special math methods for maximum time safe in cases like self + and -.
-
Feb 11th, 2017, 10:56 PM
#21
Registered User
Re: VB6 Built-in types extension library (FTypes)
I try the Samples, and find #3 is not working well.
I modify it, and this time,it produces 355
MsgBox a.Create(vbLong, 2&, Array(0&, 4&), Array(0&, 8&)).Add(b).Item(4, 9)
-
Feb 12th, 2017, 09:21 AM
#22
Thread Starter
Lively Member
Re: VB6 Built-in types extension library (FTypes)
Originally Posted by winkey88@163.com
I try the Samples, and find #3 is not working well.
I modify it, and this time,it produces 355
MsgBox a.Create(vbLong, 2&, Array(0&, 4&), Array(0&, 8&)).Add(b).Item(4, 9)
Yes. Thank you. This was a mistake =)
-
Feb 18th, 2017, 02:56 PM
#23
Thread Starter
Lively Member
Re: VB6 Built-in types extension library (FTypes)
Attachment updated:
FTypes 1.5.5 (see topic header for details). NOTE: this version is not binary compatible with previous versions.
-
Feb 19th, 2017, 02:05 AM
#24
Thread Starter
Lively Member
Re: VB6 Built-in types extension library (FTypes)
Attachment updated:
FTypes 1.5.6 (see topic header for details).
-
Feb 20th, 2017, 04:15 AM
#25
Thread Starter
Lively Member
Re: VB6 Built-in types extension library (FTypes)
Attachment updated:
FTypes 1.5.7 (see topic header for details). NOTE: this version is not binary compatible with previous versions.
-
Feb 22nd, 2017, 01:15 PM
#26
Thread Starter
Lively Member
Re: VB6 Built-in types extension library (FTypes)
Full documentation available now (see link above FTypes.zip download). PDF format. With table of content (if supported by viewer) & working links. 3.47 Mb size.
-
Feb 23rd, 2017, 03:03 AM
#27
Thread Starter
Lively Member
Re: VB6 Built-in types extension library (FTypes)
Attachment updated:
FTypes 1.5.8 (see topic header for details). NOTE: this version is not binary compatible with previous versions, but starting from this point backward compatibility will remain.
-
Feb 24th, 2017, 02:14 PM
#28
Thread Starter
Lively Member
Re: VB6 Built-in types extension library (FTypes)
Attachment updated:
FTypes 1.5.9 (see topic header for details).
-
Feb 26th, 2017, 05:05 AM
#29
Thread Starter
Lively Member
Re: VB6 Built-in types extension library (FTypes)
Attachment updated:
FTypes 1.6.0 (see topic header for details).
-
Mar 1st, 2017, 02:14 PM
#30
Thread Starter
Lively Member
Re: VB6 Built-in types extension library (FTypes)
Attachment updated:
FTypes 1.6.1 (see topic header for details). Note: ArrayEx.Sort method is planned to be introduced in next version.
Last edited by hwoarang; Mar 1st, 2017 at 02:17 PM.
-
Mar 13th, 2017, 09:19 AM
#31
Thread Starter
Lively Member
Re: VB6 Built-in types extension library (FTypes)
Attachment updated:
FTypes 1.6.2 (see topic header (samples, rev. history and manual) for details).
-
Mar 14th, 2017, 11:51 PM
#32
Thread Starter
Lively Member
Re: VB6 Built-in types extension library (FTypes)
Attachment updated:
FTypes 1.6.3 (see topic header for details).
-
Mar 18th, 2017, 09:52 AM
#33
Thread Starter
Lively Member
Re: VB6 Built-in types extension library (FTypes)
Attachment updated:
FTypes 1.6.4 (see topic header for details + sample #6).
-
Mar 21st, 2017, 03:14 AM
#34
Member
Re: VB6 Built-in types extension library (FTypes)
Good work. I'll keep testing and use it.
-
Mar 21st, 2017, 04:59 AM
#35
Thread Starter
Lively Member
Re: VB6 Built-in types extension library (FTypes)
Originally Posted by Simos
Good work. I'll keep testing and use it.
Thanks a lot) Hope lib helps with daily code routines.
-
Mar 30th, 2017, 09:09 AM
#36
Thread Starter
Lively Member
Re: VB6 Built-in types extension library (FTypes)
Attachment updated:
FTypes 1.6.5 (see topic header for details).
-
Apr 11th, 2017, 01:58 PM
#37
Re: VB6 Built-in types extension library (FTypes)
What about a Change event? So when the extended variable is declared like "Private WithEvents" it raises an event "Change", but only when the value gets effectively changed.
Example:
Code:
Private WithEvents bTest As BooleanEx
Private bAnother As Boolean
Sub DoTest()
bTest = Not bTest ' Will raise event
bTest = bTest ' No change, do not raise
End Sub
Private Sub bTest_Change()
bAnother = bTest
End Sub
-
Apr 11th, 2017, 02:10 PM
#38
Thread Starter
Lively Member
Re: VB6 Built-in types extension library (FTypes)
Surprise =) Currently working on it (exactly same mechanism in another private project). Hope to release new version of FLib soon (one-two weeks maybe) with events, interfaces and ArrayEx extensions.
-
May 28th, 2017, 05:46 AM
#39
Thread Starter
Lively Member
Re: VB6 Built-in types extension library (FTypes)
Hi guys. Any notes, bugs or else maybe ?
-
May 28th, 2017, 11:21 AM
#40
Re: VB6 Built-in types extension library (FTypes)
Thanks for sharing. I haven't used it yet, but it looks pretty good, especially ArrayEx and StringEx. When I have time, I'll test it.
I have seen a MinFrameWork(Vibian) on PsCode. It is a simple but powerful COM library for VB6 which emulates/bring some VB.NET functions. Here is its link, may be helpful to you and others:
http://www.planet-source-code.com/vb...01715423264095
I guess maybe someone will use VB6 to simulate all .NET class libraries. That would be a very interesting thing.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|