PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
Vb6 , the Future, and what I have discovered - Page 9-VBForums
Page 9 of 13 FirstFirst ... 6789101112 ... LastLast
Results 321 to 360 of 489

Thread: Vb6 , the Future, and what I have discovered

  1. #321
    PowerPoster
    Join Date
    Jun 2013
    Posts
    4,427

    Re: Vb6 , the Future, and what I have discovered

    Quote Originally Posted by techgnome View Post
    Olaf, quick question, with the format you proposed, would it still be possible to mixed types on the same line? Something tells me no, but it's not loud enough for me to believe that.

    With the All kw, I'd see it like this:

    Code:
    Dim a, b, c All As Integer, FirstName, LastName All As String, SomeVar
    Talk about reading like an English sentence!

    With that, I'd end up with three integers, two strings and one variant.
    I wouldn't be opposed to either method.
    A nice idea (quite short to type - and also with regards to "being more english-like").
    I'd still like to stick with the FreeBasic-approach, for two reasons:
    1) the FreeBasic-community has a lot of skilled developers, who are experienced with platform-independent implementations -
    .. and thus could be potential contributors to the code-base (especially when it comes to porting RC5-internal stuff to the sys-APIs on a Unix-system).
    .. If those find a "familiar concept" already implemented, that might make their decision to support these efforts more likely
    2) that one being perhaps "not as strong" as the first one, but falling into basically the same category of "more attractiveness for devs in other camps"
    .. (potential support from developers who are familiar in other languages, as e.g. C - who are used to placing the type-specifier "on the left")

    What we "old school VBers" would have to "pay in turn" (for that potential of a "stronger base of skilled Users, out of other professional camps"),
    is to "learn to live with the occasional left-hand-side type-def" (when we look e.g. into the "code of our new runtime-libs").

    What you do in your own App-Code (which only sees the outside, the Public Class-interfaces of those Runtime-Objects),
    can still be typed as you are accustomed to (which goes without saying I guess).

    To your question - your definition:
    Code:
    Dim a, b, c All As Integer, FirstName, LastName All As String, SomeVar
    Is equivalent to all of the following:
    Code:
    Dim As Integer a, b, c, As String FirstName, LastName, SomeVar As Variant '<- the first explicit type-def will break "the flow"
    Code:
    Dim As Integer a, b, c, As String FirstName, LastName, As Variant SomeVar '<- the first explicit type-def will break "the flow"
    Code:
    'SomeVar, due to moving it to the front of the declares, is now recognized "old style" as a Variant without a TypeSpecifier, 
    'the "new style" starting again after the Comma which follows SomeVar, ...
    Dim SomeVar, As Integer a, b, c, As String FirstName, LastName
    That said, these "new-style-typedefs" will perhaps be "the most readable", when one groups them "typewise" on their own Dim-Lines:
    Code:
    Dim As Integer a, b, c, 
    Dim As String FirstName, LastName
    Dim SomeVariant
    Olaf
    Last edited by Schmidt; Feb 1st, 2018 at 06:02 PM.

  2. #322

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2002
    Posts
    362

    Re: Vb6 , the Future, and what I have discovered

    Hey Guys,

    I thought I would add some humor here, look at this link from 2006:

    http://forums.codeguru.com/showthrea...ject-to-Delphi

    "Im sure that VB will remain for next year or two. I expect installation problems on new Windows versions, since MS will not provide new ServicePacks for VB6."

    12 years later here we are... Thankful though

    WP

  3. #323
    Fanatic Member
    Join Date
    Dec 2014
    Posts
    828

    Re: Vb6 , the Future, and what I have discovered

    not sure i like it at all.
    remember readability. right now even the Dim myInt% and Dim myInt as Integer can be confusing for some, if you add even more alternatives it will just make it worse.
    i dont think we should change things that works, is not that adding a new way to initialize variables changes much, we can still do it the "normal" way.
    what we need is not a new language but VB6 for the future and definitely not another VB.Net.

    jpbro suggestion to add += -= ++ (as we see this in other languages) is not a bad idea, i use it when i write as2, but do we need it? VB trying to be more like C#?

    continuing jpbro suggestion, with function "Return", is yet another good idea, but do we need it? again i use it when i code as2, so its like C#?

    if you like the syntax of other languages why do you want to code in vb6? and why do you want to make it more like something else?

    i suggest you make the 1:1 IDE first and after that we can discuss more what to add.
    Last edited by Shaggy Hiker; Feb 2nd, 2018 at 12:26 PM. Reason: We got away from throwing gas on the fire.

  4. #324
    Frenzied Member
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    1,388

    Re: Vb6 , the Future, and what I have discovered

    Quote Originally Posted by baka View Post
    i dont think we should change things that works
    I don't think so either. 1:1 backward compatibility must be carved in stone . Extensions to the language must adhere to this edict. Similar to Linus Torvald's edict that you must *not* break user-space, we must *not* break existing VB6 code with any new compiler.

    Quote Originally Posted by baka View Post
    not sure i like it at all. remember readability. right now even the Dim myInt% and Dim myInt as Integer can be confusing for some, if you add even more alternatives it will just make it worse.
    I can see your point here. Too many alternatives can make things unnecessarily complex, especially for beginners. For example, how should sample code and documentation be written? Do we need a style-guide for the authoritative documentation/code samples? Or will it just be a free-for-all?

    The language is called "Basic" after all, so I think it must continue to appeal to beginners, and make life easier for beginners.

    I personally don't like the $, %, &, etc... decorators for variables, and I think they make things difficult for beginners. I don't like a lot of ":" separated instructions on one line for the same reasons.

    Yet many of us who literally began programming with VB6 (or earlier Basics) can no longer be considered "beginners". Yet we still love the language and would like to see it extended. So the C-like stuff is important too (without being too C-like). Just as the .Net and Javascript and other "modern" language stuff (like the "this" and Try..Catch..Finally) can be useful. I think we're in a unique position to look both backwards and forwards and try to integrate the "best" of everything into this new/old VB.

  5. #325
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    32,560

    Re: Vb6 , the Future, and what I have discovered

    Quote Originally Posted by baka View Post
    not sure i like it at all.
    remember readability. right now even the Dim myInt% and Dim myInt as Integer can be confusing for some, if you add even more alternatives it will just make it worse.
    i dont think we should change things that works, is not that adding a new way to initialize variables changes much, we can still do it the "normal" way.
    what we need is not a new language but VB6 for the future and definitely not another VB.Nuts.

    jpbro suggestion to add += -= ++ (as we see this in other languages) is not a bad idea, i use it when i write as2, but do we need it? VB trying to be more like C#?

    continuing jpbro suggestion, with function "Return", is yet another good idea, but do we need it? again i use it when i code as2, so its like C#?

    if you like the syntax of other languages why do you want to code in vb6? and why do you want to make it more like something else?

    i suggest you make the 1:1 IDE first and after that we can discuss more what to add.
    If not to add to the functionality of VB and add new things, then what are we discussing here? It sounds like VB6 as it is, right now, with no improvements, nothing adding is sufficient for you. Which is fine. For some it isn't. That's what this discussion is now... tossing around ideas of things that we'd like to see added... as good as VB6 is, if we're rebuilding and IDE & compiler, might as well toss in a few extra goodies while we're at it, right? If it makes it more like C/C++/C#/Java... what's wrong with that? At least no one has suggested curry brackets (yet).

    And the use of Return, that's more than C#as well... lots of languages use Return.

    To answer your main question though - no we don't NEED any of it... Just like I don't NEED a Bugati .... but it sure as hell would be fun to have one!

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  6. #326
    PowerPoster
    Join Date
    Jun 2013
    Posts
    4,427

    Re: Vb6 , the Future, and what I have discovered

    Quote Originally Posted by Sitten Spynne View Post
    Long term feature request:
    (I agree with the general theme of the last few posts, that "cloning VB6" is already an ambitious goal so if release 1 includes "also improve it" it'll take that much longer. That said, it can't hurt to brainstorm "down the road" features even if they're tabled for later. My favorite upcoming C# feature's already been delayed for 4 language versions!)

    So here's what I think is the most valuable feature in VB .NET. It adds enough flexibility and power that if it weren't an object-oriented language, you can use this feature to implement features like polymorphism. .NET calls them "delegates", everyone else is content with "function pointers" and I think that helps understand what they are.
    As I wrote already, in the "VB.Next"-compiler I'd like to expand a bit more on that front (but perhaps in version 1.1 or something) -
    *but* then in a way which opens VB6 a bit more to the lower level (the "C-side", which works underneath it anyways...)

    WIth that I basically mean:
    - a more capable AddressOf-operator (which for example would recognize also Function-Pointers, defined in Classes)
    - ability to define "plain function-prototypes" (FreeBasic is using the Declare Statement for that task, which I think is a good idea)
    - ability to assign (fill) "Function-Variables" directly per AddressOf (if these Variables adhere to the "Type-of-Function" which was defined in a Declare-Statement, or a COM-method)

    For more OOP-fanciness on the "higher-level" I'd like to go with the (already mentioned by wqweto, and also the default in VBScript and the IE-WebBrowser)
    "default-method of a given Object-instance" (then passing the Object instead of the function) - and that, when being accompanied by the feature,
    to flag certain important Method-attributes (as e.g. Default, or Enumerator directly in code (instead of the currently required Dialogue), would already be
    a quite powerful thing - especially when you keep the already mentioned COM-Events in mind, which will are always there for the more common problems).

    I'm not a big fan of anonymous functions for example, as I find myself typing "these guys" in my JavaScript-code, but often later replacing them
    by explicitely defined routines which have a "speaking name" - then placing that speaking symbol instead of the anonymous function-blob (e.g. into an EventCallback-slot).

    I "leave them be" sometimes (for really short stuff) - but they kind of represent to me a line in the sand, where "fancyness starts getting overboard" -
    (and don't get me started on "monads" or the like)... the overall-usefulness of these things in "day to day, common tasks" is highly questionable -
    but the "coolness-factor" is apparently "alluring" to a lot of developers.

    Don't get me wrong - I'm not saying that a functional language (like e.g. Haskell) or the concept as a whole does not have its place -
    but the fields where I see a VB6-successor "at work", are IMO different ones.

    Quote Originally Posted by Sitten Spynne View Post
    For example, suppose I'm reading a CSV file where each line represents customer data. Here's how I could get the 10 customers who owe me the most money in the state of Texas:
    Code:
    Dim topTen = File.EnumerateLines(path)
                     .Select(AddressOf ParseCustomer)
                     .Where(Function(c) c.State = "TX")
                     .OrderBy(Function(c) c.Balance)
                     .Take(10)
    Good example for "too much fanciness" IMO - I find LINQ like extensions one of the most horrible "inventions",
    since "NOSQL-DBs".

    Good programs need good structure(s).

    C-like Structs (just another name for VB-UDTs) and Classes (which are just "structs with a few function-pointers in addition" in the end) -
    together with SQL-Table-Definitions (which resemble Struct- or UDT-definitions, when you type each Field-Def in a Create-Table-Stament on its own line)...

    All those "look alike" for a reason - and represent the same paradigm:
    "Before you begin typing your implementation-code, think about the data".
    (how to give it structure - and how to "normalize it").

    In your above snippet, you have to define a customer-object (no code for that is seen currently) -
    and also a ParseCustomer-Method (also without any code for that) - and it remains to be seen,
    whether a separately defined Customer-Class is the right thing to do in this case - gathering your
    filtered results in a more generic Object (which is already present in your runtime) might be entirely sufficient,
    when we talk about "temporary results" like the above.

    As for LINQ, I know that it integrates with intellisense - but a good SQL-Editor would offer roughly the same thing.

    In VB6, we would either use ADO to import the CSV "in one line" into a DB-Table, and then query that per SQL
    (getting handed out a generic "multicolumn-DataType-Object" which would be entirely sufficient IMO.

    Or even faster - the same thing is possible when we'd import the CSV into an SQLite-InMemory-Table -
    and then query from there (with a single line of code, handing out an RC5-Recordset, which is quite identical to an ADO-Rs).

    So, what your above code would boil down to in VB6 is:
    Set MemDB = ImportCSVGenericallyInto("CustImport", PathTOCSVFile)

    followed by:
    Set Rs = MemDB.GetTable("CustImport", "State='TX'", "Balance Asc Limit 10")

    The 10 Records then available in a generic multi-column-object.

    Then you might want to get another, differently filtered list from that CSVImport per SQL - good that we have it
    already in our MemDB (which lives on, in case you declared it with appropriate scope, e.g. at Form-Level).

    So the parsing from the CSV had to be done only once into the InMemory-DB-Table, which now supports your
    UserCode with filter-options on temporary data, with the "full power of full SQL" (including Joins, CTEs,
    indexing if you need it, etc.) - most Recordsets queryable in a single line.

    SQLite-InMemory-DB access, returning Rs-Objects works faster than LINQ in most scenarios BTW.

    That's not written as an "excuse to avoid learning something new" - it is written with the
    knowledge about "those other alternatives", which still cannot compete (performance-wise) -
    and would clutter a formerly easy to grasp language with in my opinion unnecessary "extra-complexity".

    Olaf

  7. #327
    Frenzied Member wqweto's Avatar
    Join Date
    May 2011
    Posts
    1,603

    Re: Vb6 , the Future, and what I have discovered

    Btw, delegates could be used to implement currying and closures like that
    Code:
    Private Sub MyMethod(a As Long, ByVal b As Long) As Long
        Debug.Print a, b
        a = a + 1
        MyMethod = a
    End Sub
    
    Dim callback As Object
    Set callback = DelegateOf(obj.MyMethod)
    ...
    result = callback(1, 2)   ' -> 1 2
    ...
    
    '--- f(x, y) -> bind 5 to x and return g(y)
    Dim curried As Object
    Set curried = DelegateOf(obj.MyMethod, 5)
    result = curried(6)        '-> 5 6
    ...
    '--- f(x, y) -> bind ref hoisted to x and return g(y)
    Dim hoisted As Long
    hoisted = 10
    Dim closure As Object
    Set closure = DelegateOf(obj.MyMethod, hoisted)
    result = closure(20)     '-> 10 20
    result = closure(20)     '-> 11 20
    result = closure(20)     '-> 12 20
    Debug.Print hoisted ' -> 13
    Closures might require boxing of native types, or could work for references and global scope natives only.

    This together with local functions will allow to implement something similar to LINQ
    Code:
    Private Sub Process(col As IEnumerable)
        Local Function NonEmpty(elem As Variant) As Boolean
            NonEmpty = LenB(elem) <> 0
        End Function
    
        Local Function GetLength(elem As Variant) As Long
            GetLength = Len(elem)
        End Function
    
        Set Process = col.Where(DelegateOf(NonEmpty)).Select(DelegateOf(GetLength))
    End Sub
    Probably extension methods would be handy here too.

    cheers,
    </wqw>

  8. #328
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    1,931

    Re: Vb6 , the Future, and what I have discovered

    Quote Originally Posted by jpbro View Post
    I can see your point here. Too many alternatives can make things unnecessarily complex, especially for beginners.
    Exactly. We don't have to think only about us, we should think in when we started learning VB.
    I expect that a lot of people will start learning the new version of VB (specially if it can be used for web design).
    And now I'm thinking that it is a bad idea to add too many options.
    IMO it is better a language a bit verbose but clearer and easy to understand and follow, that one that require less typing but is only "better" for experts.

    This is one of the strengths that made VB successful in the past. If we convert the code in jargon, we lose one of the main advantages of the language.

    As someone already pointed out: why not to go to C?
    Last edited by Eduardo-; Feb 2nd, 2018 at 06:26 AM.

  9. #329
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    1,931

    Re: Vb6 , the Future, and what I have discovered

    I agree with Sitten Spynne when he said that every new feature must be weighted carefully.
    What value does it add? What problems or confussions can it cause? (specially for beginners).
    A VB6 succesor should not lose sight of beginners, by any means.

    My opinion regarding the declarations:

    I liked two things:
    1) The ADD clause.
    2) The default value.

    Other than that, I vote for leaving it as it is now.
    I know that there might be strong reasons to make some desissions, but in the long term they could perhaps harm more than they helped in a middle stage.

    I'm thinking in a very popular language, not something tailored for the taste of the ten experts in this thread.
    To express opinions and suggestions is very good, please don't get me wrong. My point is that beginners are not here to vote.
    Last edited by Eduardo-; Feb 2nd, 2018 at 06:33 AM.

  10. #330
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    5,639

    Re: Vb6 , the Future, and what I have discovered

    Quote Originally Posted by Schmidt View Post
    As for LINQ, I know that it integrates with intellisense - but a good SQL-Editor would offer roughly the same thing.

    In VB6, we would either use ADO to import the CSV "in one line" into a DB-Table, and then query that per SQL
    (getting handed out a generic "multicolumn-DataType-Object" which would be entirely sufficient IMO.

    Or even faster - the same thing is possible when we'd import the CSV into an SQLite-InMemory-Table -
    and then query from there (with a single line of code, handing out an RC5-Recordset, which is quite identical to an ADO-Rs).

    So, what your above code would boil down to in VB6 is:
    Set MemDB = ImportCSVGenericallyInto("CustImport", PathTOCSVFile)

    followed by:
    Set Rs = MemDB.GetTable("CustImport", "State='TX'", "Balance Asc Limit 10")

    The 10 Records then available in a generic multi-column-object.

    Then you might want to get another, differently filtered list from that CSVImport per SQL - good that we have it
    already in our MemDB (which lives on, in case you declared it with appropriate scope, e.g. at Form-Level).

    So the parsing from the CSV had to be done only once into the InMemory-DB-Table, which now supports your
    UserCode with filter-options on temporary data, with the "full power of full SQL" (including Joins, CTEs,
    indexing if you need it, etc.) - most Recordsets queryable in a single line.
    Just to be clear, are you talking about using ADO to query, filter and project data in memory?
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena


    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. -jmcilhinney

  11. #331
    Frenzied Member
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    1,388

    Re: Vb6 , the Future, and what I have discovered

    Quote Originally Posted by Eduardo- View Post
    Exactly. We don't have to think only about us, we should think in when we started learning VB.
    I expect that a lot of people will start learning the new version of VB (specially if it can be used for web design).
    And now I'm thinking that it is a bad idea to add too many options.
    IMO it is better a language a bit verbose but clearer and easy to understand and follow, that one that require less typing but is only "better" for experts.
    We should definitely keep beginners in mind, but I do think there is value to adding features for more seasoned VB6 programmers. The initial "market" will probably consist almost exclusively of those who have been using VB6 for a long time, so there needs to be compelling reasons for them to use the new version. Maybe all outer framework stuff is enough, but I think some language extensions that make things easier/more efficient would be good to.

    When I have to do some work in other languages (Javascript, Perl, Pascal, etc...) the things I listed are things that I miss when I come back to VB6, and they are things that I understood almost immediately when I started using those other languages (which is why I felt they might be useful in any new effort).

    Quote Originally Posted by Eduardo- View Post
    As someone already pointed out: why not to go to C?
    I don't think C is a nice as VB, especially for the "visual" part/GUI stuff, but I also don't like the curly braces, the way you indicate pointers (or pointers to pointers), or the way you do different string encodings (L"Hello, world.")...While C might be nice to write, I find it quite ugly to read TBH. That doesn't mean I think it doesn't do anything right though, and every other language I've used has many of the language features I mentioned (so any programmer migrating from another language is going to expect/want them).

  12. #332
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    1,931

    Re: Vb6 , the Future, and what I have discovered

    This is more a library suggestion than a language suggestion:

    Code:
    Private WithEvents mApp As App
    
    Private Sub mApp_FormInitialized(nForm As Form)
    
    End Sub
    
    Private Sub mApp_FormLoaded(nForm As Form)
    
    End Sub
    
    Private Sub mApp_SystemChange(ChangeType As SystemParamConstants, Params())
        ' screen resolution, system colors changes, Etc.
    End Sub
    To automate things we need control over what is happening, specially from an ActiveX Component.

  13. #333
    Frenzied Member
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    1,388

    Re: Vb6 , the Future, and what I have discovered

    Quote Originally Posted by Eduardo- View Post
    This is more a library suggestion than a language suggestion
    Definitely a library suggestion, but the basic principle (if not the implementation) is a good one for modern apps. Some way to know if the "screen" has changed (rotation, unplugging a monitor, DPI changes, etc...) would be very handy for developing responsive apps. It might be enough to fire a Resize event for all of those things though?

    While we're discussing library extensions, I can also see a benefit in adding events for things like Sleep & Wake...maybe even a "OnBattery" and "LowBattery" or similar events/properties would be useful. It would allow you to manage background stuff you might be doing.

    Also, touch events would be nice - ways to handle pinch & zoom, multi-touch, etc...

    Overall though, I think discussion of library extensions is getting a bit ahead of ourselves.

  14. #334
    Fanatic Member
    Join Date
    Dec 2014
    Posts
    828

    Re: Vb6 , the Future, and what I have discovered

    i can not think of what to add language wise, only what i want the language to be able to do,
    like the reg-free dll usage, to be able to compile/build dll/ocx that we can use without the need to register, and we can use the dll we make like any API.

    i would also like a more flexible component part, when creating a new project, there should not be any at all, except the "core",
    so if i want a "form", i need to add it, if i want listbox/picturebox etc, also need to add.

    the components should be like "plugins", we add what we need and we include it in the package when we release it.
    should not be any installation at all. so portable.

    what i hope is that we have a community that creates "plugins" that we can use, different forms, different buttons etc.

  15. #335
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,834

    Re: Vb6 , the Future, and what I have discovered

    You know? This thread has made me think about what it would take to get me to move my primary project off of VB6.

    And, before I outline that, let me say that I'm in a very similar situation as several others who have participated in this thread: 1) Thought about .NET but it just wasn't compatible enough, or 2) Have looked at other options but they're either just not compatible enough or they don't inspire me with enough confidence that they'll be around and supported for the duration (or both).

    So, if I were to truly consider moving my primary project to something else, I see only two viable options (maybe a third):

    1) If Microsoft were to release a COM-based VB7.

    2) If some 99.5% compatible open-source VB6 IDE clone were to be released. And notice that I emphasize open-source, because that's about the only way I could come to trust that it'd be around for the duration, and adequately supported.

    3) Some multi-national company (like Alphabet or IBM) were to release a product that they advertised as a VB6 COM-based clone (possibly with new features).

    I see the third option has even less likely than the first two, and that's why I hesitated to even mention it. I know it's tilting at windmills, but I probably still see the first option as most likely.

    It just seems like people get too distracted with enhancements (not to mention any names) to ever get #2 done. It'd truly be super cool if someone just came out with an open-source clone of the VB6 IDE without any enhancements whatsoever.

    Y'all Take Care,
    Elroy
    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. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  16. #336
    You don't want to know.
    Join Date
    Aug 2010
    Posts
    4,580

    Re: Vb6 , the Future, and what I have discovered

    Yeah I want to say while I like to talk about enhancements, I think focusing on the "clone" aspect first is smart. That is the loudest, largest requirement. Enhancements are gravy, and don't matter if you don't have a finished product.
    This answer is wrong. You should be using TableAdapter and Dictionaries instead.

  17. #337
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    32,560

    Re: Vb6 , the Future, and what I have discovered

    Quote Originally Posted by Sitten Spynne View Post
    Yeah I want to say while I like to talk about enhancements, I think focusing on the "clone" aspect first is smart. That is the loudest, largest requirement. Enhancements are gravy, and don't matter if you don't have a finished product.
    I would agree with that 150% as well. Otherwise you get too focused on that gravy and then the project never happens. I believe that's one of the reasons Olaf has previously stated (in other threads) as a reason to keep the project close to the vest for now at least. If other start getting involved, they may try to start interjecting their own enhancements too early.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  18. #338
    PowerPoster ChrisE's Avatar
    Join Date
    Jun 2017
    Location
    Frankfurt
    Posts
    2,121

    Re: Vb6 , the Future, and what I have discovered

    Quote Originally Posted by Niya View Post
    Just to be clear, are you talking about using ADO to query, filter and project data in memory?
    Hi Niya,

    here is one way of doing it. I created from the Northwind-Customers table a CSV and added a Field Currency.
    I open the CSV direct and filter the Top-Ten from USA, this I write to a new CSV-File.

    Code:
    Private Sub Command12_Click()
    Dim strSql As String
    Dim MyTotal As Currency
    Set cn = New ADODB.Connection
    
    'or with :
    'Set cn = CreateObject("ADODB.Connection")
      
      With cn
        .Open "Provider=Microsoft.Jet" _
                & ".OLEDB.4.0;Data Source= c:\" _
                & ";Extended Properties=""text;HDR=YES;FMT=Delimited"""
         End With
        Set rs = New Recordset
        rs.CursorLocation = adUseClient
    'CSV File = C:\CustTestMoney.csv
    'if there were no Headers then the Fields would be F1, F2, F3 etc...
    strSql = "SELECT TOP 10 CompanyName, Country, Sum(OMoney) AS [SumOMoney]"
    strSql = strSql & " From [CustTestMoney.csv]"
    strSql = strSql & " GROUP BY CompanyName, Country"
    strSql = strSql & " Having (((Country) = 'USA'))"
    strSql = strSql & " ORDER BY Sum(OMoney) DESC;"
        
        rs.Open strSql, cn, adOpenStatic, adLockOptimistic
    'see the result if you want in Datagrid
    '      Set DataGrid1.DataSource = rs 
        
      Dim FNr As Integer
      Dim strPath As String
    'Create new CSV
      strPath = "C:\TopTen_MoneyOwn.csv"
      FNr = FreeFile
      Open strPath For Output As FNr
      Me.MousePointer = vbHourglass
      Do While rs.EOF = False
      'write the Top Ten to new CSV-File
        If Not IsNull(rs!CompanyName) Then Print #FNr, rs!CompanyName; ";" & rs!Country & ";" & rs!SumOMoney
        rs.MoveNext
        DoEvents
      Loop
      Close #FNr
       Me.MousePointer = vbDefault
      rs.Close
      Set rs = Nothing
    End Sub
    I don't know SQLite, I'm sure Olaf will provide a sample


    not sure if VB6 or .Net has an advantage here to work with CSV, probably just a matter of...
    what you like better.

    EDIT:
    or just Import the CSV to a new Table in Access and sort it there
    Code:
    Private Sub Command1_Click()
    Dim strSql As String
    'Import CSV to new Table"
    strSql = "Select * Into MyImport From [CustTestMoney.csv] IN 'c:\' 'Text;'"
    Cn.Execute strSql
    End Sub
    regards
    Chris
    Last edited by ChrisE; Feb 2nd, 2018 at 11:52 AM.
    to hunt a species to extinction is not logical !
    since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.

  19. #339
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    34,293

    Re: Vb6 , the Future, and what I have discovered

    Quote Originally Posted by Elroy View Post
    1) If Microsoft were to release a COM-based VB7.

    2) If some 99.5% compatible open-source VB6 IDE clone were to be released. And notice that I emphasize open-source, because that's about the only way I could come to trust that it'd be around for the duration, and adequately supported.

    3) Some multi-national company (like Alphabet or IBM) were to release a product that they advertised as a VB6 COM-based clone (possibly with new features).

    I see the third option has even less likely than the first two, and that's why I hesitated to even mention it. I know it's tilting at windmills, but I probably still see the first option as most likely.
    I think the second one is the only likely one. I know that a bunch of the "institutional knowledge" that MS used to have around VB6 has left the building. A whole bunch have retired or otherwise moved on. The re-training needed on the code base is probably beyond their desires. If they were to try to revise VB6.5 (that's the title), it would likely mean starting from scratch as far as intellectual capital is concerned.

    Gotta say, though, this discussion has become a standards debate, which is REALLY nice to see. Standards debates always get into the details, and there's nothing wrong with that. People put forwards a proposal, others argue against it, and any fatal flaws will generally come to light before the proposal gets anywhere that the flaws could do any harm.
    My usual boring signature: Nothing

  20. #340
    Lively Member jj2007's Avatar
    Join Date
    Dec 2015
    Posts
    122

    Re: Vb6 , the Future, and what I have discovered

    Quote Originally Posted by jpbro View Post
    I also don't like the curly braces, the way you indicate pointers (or pointers to pointers), or the way you do different string encodings (L"Hello, world.")...While C might be nice to write, I find it quite ugly to read TBH.
    Right! C is assembly in disguise, with {curly and (not so curly) brackets} all over the place, plus semicolons for compilers that have never learned what an end of line character is. Switches that "fall thru" if you don't tell them to "break" - yeah, it's ugly. Unfortunately, that's what "professional" programmers have to learn nowadays. Actually, assembler syntax, especially the Masm32 SDK, is a lot closer to Basic than any C compiler, for historical reasons.

  21. #341
    PowerPoster
    Join Date
    Feb 2006
    Posts
    20,706

    Re: Vb6 , the Future, and what I have discovered

    Quote Originally Posted by Shaggy Hiker View Post
    I know that a bunch of the "institutional knowledge" that MS used to have around VB6 has left the building. A whole bunch have retired or otherwise moved on. The re-training needed on the code base is probably beyond their desires. If they were to try to revise VB6.5 (that's the title), it would likely mean starting from scratch as far as intellectual capital is concerned.
    I agree that's a big piece of it.

    VB6.exe (the IDE and pass 1 incremental compiler and "make" tool) performs pass 2 native code generation by invoking C2.exe which is a version of the VC++ compiler's pass 2 packaged as an EXE instead of a DLL. This C2 "knows about" the p-code and symbol tables produced by VB6.exe.

    Well, VC has changed a lot over the years, and there hasn't been a C2 (DLL or otherwise) for a VERY long time that knows anything about VB6.exe's intermediate output. I think it was completely re-engineered back around 2007 (I forget the code name of that New C2 project), and the VB-awareness was stripped out long before that.

    So while they of course have the old VC/VB 6.0 source code around probably nobody around has looked at it in two decades, if indeed any of them are still around.

  22. #342
    Junior Member
    Join Date
    Dec 2017
    Posts
    29

    Re: Vb6 , the Future, and what I have discovered

    Quote Originally Posted by techgnome View Post
    I would agree with that 150% as well. Otherwise you get too focused on that gravy and then the project never happens. I believe that's one of the reasons Olaf has previously stated (in other threads) as a reason to keep the project close to the vest for now at least. If other start getting involved, they may try to start interjecting their own enhancements too early.

    -tg
    I pretty much agree with that too.
    And may i add one more thing: I'm not the best person to say this (not a programmer, not even a serious hobbyist) but I kept an eye on programming languages since the days of the early 80's home computers and my observation is that today's practices are kinda hit by trends. Many languages seem to have evolved by trying too hard to look like the more popular ones. Some "invented" scripting languages used in game engines are almost C++ in disguise. Nice philosophies like open source which have both a practical and a "coolness" factor seem to now be driven more from the second factor rather than the first. Curly braces everywhere. Sure, one can get used to them as a code block container, but if i were to push a button and destroy all evidence of programming languages on this planet, I bet no one would re-invent them again.

    I may be wrong about all of the above but that's my feeling and I wouldn't want a new incarnation of vb6 to be bloated by "cool" things unless they are the useful kind of "cool". If I were to describe what's so nice about vb6 in one sentence, that would be that it hides the complexity and gives it to you back whenever you want it.

  23. #343
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,834

    Re: Vb6 , the Future, and what I have discovered

    Quote Originally Posted by Shaggy Hiker View Post
    I know that a bunch of the "institutional knowledge" that MS used to have around VB6 has left the building. A whole bunch have retired or otherwise moved on. The re-training needed on the code base is probably beyond their desires. If they were to try to revise VB6.5 (that's the title), it would likely mean starting from scratch as far as intellectual capital is concerned.
    Shaggy, I just don't see how that's possible. I suppose it is in a certain sense. However, let's think about what IS still happening within Microsoft. And specifically, they're continuing development of their VBA products. Maybe I'm missing something, but the only big distinction I see between VB6 and contemporary versions of VBA (especially when considering VB6 a subset of VBA) is the lack of a machine-code compiler.

    Sure, this is a pretty big chunk, but I can't believe it's all that huge when compared to all the IDE actually does. Also, IMHO, it just doesn't seem that big a leap to get from p-code to machine-code. Granted, it's not trivial though.

    I guess all I'm saying is, it's only that piece that the "institutional knowledge" may be lost. Given a half-dozen whipper-snappers who understand the VBA and the source code to the VB6 compiler (i.e., C2.EXE), I bet they could get on top of it in two or three months, repackaging it with LongLong and Decimal native type support, and Unicode throughout. And, this would be a pittance for Microsoft. IMHO, it clearly comes down to marketing strategy, and has nothing to do with intellectual ability.

    Best Regards,
    Elroy
    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. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  24. #344
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,834

    Re: Vb6 , the Future, and what I have discovered

    Quote Originally Posted by immortalx View Post
    I wouldn't want a new incarnation of vb6 to be bloated by "cool" things unless they useful kind of "cool".
    I couldn't agree more with that statement!!!

    However, there are some "kind of cool" things that wouldn't be bloat (at least not IMHO). Here's a list I keep of things I'd just see as "clean up":

    • Fix the Intellisense bug when using Enumerations.
    • Full intrinsic support for LongLong.
    • 32-bit and 64-bit machine-code compilation (with LongPtr support so only one source code version is needed).
    • Intrinsic type for Decimal.
    • An "Option ExplicitType" to stop default variant declarations.
    • Built-in Vista and Metro styling themes.
    • Full unicode support in all the intrinsic controls (and Property window, and Property pages).
    • Fix bug that doesn't catch type mismatch when using UDT arrays.
    • An "Option ExplicitRedim" that dis-allows a Redim from creating an array (as it should already be created with a Dim).
    • Allow WithEvents on object arrays.
    • Fix IDE bug where it gets confused with module highlighting in the Project window when adding/deleting modules.


    I've got more, but they start to dip into the "enhancements" category rather than the "clean-up" category.

    If just that list were addressed, I'd totally spend, say, $400 for VB6.5.

    Best Regards,
    Elroy

    EDIT1: I'd also really like to add unsigned support for two-byte, four-byte, and eight-byte integers (even if just in Variants), but I'd still be very excited if I didn't get that one.
    Last edited by Elroy; Feb 2nd, 2018 at 03:19 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. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  25. #345
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    34,293

    Re: Vb6 , the Future, and what I have discovered

    Quote Originally Posted by immortalx View Post
    I pretty much agree with that too.
    And may i add one more thing: I'm not the best person to say this (not a programmer, not even a serious hobbyist) but I kept an eye on programming languages since the days of the early 80's home computers and my observation is that today's practices are kinda hit by trends. Many languages seem to have evolved by trying too hard to look like the more popular ones. Some "invented" scripting languages used in game engines are almost C++ in disguise. Nice philosophies like open source which have both a practical and a "coolness" factor seem to now be driven more from the second factor rather than the first. Curly braces everywhere. Sure, one can get used to them as a code block container, but if i were to push a button and destroy all evidence of programming languages on this planet, I bet no one would re-invent them again.

    I may be wrong about all of the above but that's my feeling and I wouldn't want a new incarnation of vb6 to be bloated by "cool" things unless they are the useful kind of "cool". If I were to describe what's so nice about vb6 in one sentence, that would be that it hides the complexity and gives it to you back whenever you want it.
    I wasn't going to say anything, cause doggone I've got too many posts in this thread, but this post was too cool to pass up.

    All the languages ARE starting to look the same, and I totally agree that if they were all wiped out, we sure wouldn't come back to the same endpoint, but what is fascinating to me is whether or not we would come back to ANY endpoint. Pretty nearly all the most commonly used languages now fall into the C-syntax family. The C syntax is distinguished, at least in part, by carrying forwards some anachronisms forced upon it due to its ancient roots. Things like case sensitivity and semicolons (now that I've had lunch, I can even talk about those 'curry' braces some of you mentioned) were due largely to the fact that the language was written at a time when computers had no reserve processing power. You didn't want any extra key strokes, and the computer sure couldn't case correct your text all that easily.

    However, there appears to be a bit of convergent evolution going on with languages. This is likely due to a couple factors:

    1) LOADS of coders learned C/C++ early on.
    2) MS is an English-speaking company, as is Apple.
    3) And possibly...we're a bunch of geeks.

    Even the highly symbol-oriented C uses English words when it uses words. It would be a different world if programming languages used Chinese characters rather than If, For, and so on. This is probably due to coding taking off first in both England and the US. The fact that so many people learned C/C++ early on (I believe those were the ONLY languages taught in the college I went to), when they decide to write a new language, they tend to reach for the syntax they already knew. Alternatively, it may be that when people went to a new language, they tended to favor ones that looked like what they already knew.

    At least, that's my take on why so many languages fall into the C-syntax camp, even if not adhering to it perfectly. As for the third item, I've always had a suspicion that some people like C because you can write meaningful code that looks like nothing more than line noise to the uninitiated. We tend to be a clannish species given to secret handshakes, rituals, and phrases, so C may well appeal to some folks just because it looks so doggone arcane.

    @Elroy: You may be right. I hadn't thought about how much VBA is close to VB6. I do know two people who have retired from that group, though, and that was LONG ago, so I would expect there have been many more.
    My usual boring signature: Nothing

  26. #346
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    1,931

    Re: Vb6 , the Future, and what I have discovered

    Quote Originally Posted by Shaggy Hiker View Post
    I wasn't going to say anything, cause doggone I've got too many posts in this thread, but this post was too cool to pass up.

    All the languages ARE starting to look the same, and I totally agree that if they were all wiped out, we sure wouldn't come back to the same endpoint, but what is fascinating to me is whether or not we would come back to ANY endpoint. Pretty nearly all the most commonly used languages now fall into the C-syntax family. The C syntax is distinguished, at least in part, by carrying forwards some anachronisms forced upon it due to its ancient roots. Things like case sensitivity and semicolons (now that I've had lunch, I can even talk about those 'curry' braces some of you mentioned) were due largely to the fact that the language was written at a time when computers had no reserve processing power. You didn't want any extra key strokes, and the computer sure couldn't case correct your text all that easily.

    However, there appears to be a bit of convergent evolution going on with languages. This is likely due to a couple factors:

    1) LOADS of coders learned C/C++ early on.
    2) MS is an English-speaking company, as is Apple.
    3) And possibly...we're a bunch of geeks.

    Even the highly symbol-oriented C uses English words when it uses words. It would be a different world if programming languages used Chinese characters rather than If, For, and so on. This is probably due to coding taking off first in both England and the US. The fact that so many people learned C/C++ early on (I believe those were the ONLY languages taught in the college I went to), when they decide to write a new language, they tend to reach for the syntax they already knew. Alternatively, it may be that when people went to a new language, they tended to favor ones that looked like what they already knew.

    At least, that's my take on why so many languages fall into the C-syntax camp, even if not adhering to it perfectly. As for the third item, I've always had a suspicion that some people like C because you can write meaningful code that looks like nothing more than line noise to the uninitiated. We tend to be a clannish species given to secret handshakes, rituals, and phrases, so C may well appeal to some folks just because it looks so doggone arcane.

    @Elroy: You may be right. I hadn't thought about how much VBA is close to VB6. I do know two people who have retired from that group, though, and that was LONG ago, so I would expect there have been many more.
    +1 to all that

  27. #347
    Hyperactive Member
    Join Date
    Apr 2015
    Posts
    454

    Re: Vb6 , the Future, and what I have discovered

    Quote Originally Posted by Elroy View Post
    [*]32-bit and 64-bit machine-code compilation (with LongPtr support so only one source code version is needed).
    If just that list were addressed, I'd totally spend, say, $400 for VB6.5.
    I would pay the double for only this.

  28. #348
    Addicted Member
    Join Date
    Sep 2015
    Posts
    174

    Re: Vb6 , the Future, and what I have discovered

    Surely I'd pay a fortune with pleasure to save my investment!

  29. #349
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    5,639

    Re: Vb6 , the Future, and what I have discovered

    Quote Originally Posted by ChrisE View Post
    Hi Niya,

    here is one way of doing it. I created from the Northwind-Customers table a CSV and added a Field Currency.
    I open the CSV direct and filter the Top-Ten from USA, this I write to a new CSV-File.

    Code:
    Private Sub Command12_Click()
    Dim strSql As String
    Dim MyTotal As Currency
    Set cn = New ADODB.Connection
    
    'or with :
    'Set cn = CreateObject("ADODB.Connection")
      
      With cn
        .Open "Provider=Microsoft.Jet" _
                & ".OLEDB.4.0;Data Source= c:\" _
                & ";Extended Properties=""text;HDR=YES;FMT=Delimited"""
         End With
        Set rs = New Recordset
        rs.CursorLocation = adUseClient
    'CSV File = C:\CustTestMoney.csv
    'if there were no Headers then the Fields would be F1, F2, F3 etc...
    strSql = "SELECT TOP 10 CompanyName, Country, Sum(OMoney) AS [SumOMoney]"
    strSql = strSql & " From [CustTestMoney.csv]"
    strSql = strSql & " GROUP BY CompanyName, Country"
    strSql = strSql & " Having (((Country) = 'USA'))"
    strSql = strSql & " ORDER BY Sum(OMoney) DESC;"
        
        rs.Open strSql, cn, adOpenStatic, adLockOptimistic
    'see the result if you want in Datagrid
    '      Set DataGrid1.DataSource = rs 
        
      Dim FNr As Integer
      Dim strPath As String
    'Create new CSV
      strPath = "C:\TopTen_MoneyOwn.csv"
      FNr = FreeFile
      Open strPath For Output As FNr
      Me.MousePointer = vbHourglass
      Do While rs.EOF = False
      'write the Top Ten to new CSV-File
        If Not IsNull(rs!CompanyName) Then Print #FNr, rs!CompanyName; ";" & rs!Country & ";" & rs!SumOMoney
        rs.MoveNext
        DoEvents
      Loop
      Close #FNr
       Me.MousePointer = vbDefault
      rs.Close
      Set rs = Nothing
    End Sub
    I don't know SQLite, I'm sure Olaf will provide a sample


    not sure if VB6 or .Net has an advantage here to work with CSV, probably just a matter of...
    what you like better.

    EDIT:
    or just Import the CSV to a new Table in Access and sort it there
    Code:
    Private Sub Command1_Click()
    Dim strSql As String
    'Import CSV to new Table"
    strSql = "Select * Into MyImport From [CustTestMoney.csv] IN 'c:\' 'Text;'"
    Cn.Execute strSql
    End Sub
    regards
    Chris
    Thanks for the example.

    As for my thoughts. While it is a solution, compared to a LINQ based solution, that is far too verbose. But it's biggest weakness is that this ADO based solution is only suitable for use on data. LINQ can be used to query, filter and transform actual objects.

    Now Olaf made it pretty clear he doesn't like LINQ. The good thing is, he doesn't need to create an alternative implementation but if he implements higher order functions and delegates in his compiler as Sitten suggested, people like me who find LINQ useful can implement it for themselves. Such an implementation could even be a CodeBank submission. All LINQ really boils down to is clever use of delegates. It won't be as pretty as .Net's version without generics but we could implement something reasonable.

    And the purists who don't like it, don't have to use it.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena


    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. -jmcilhinney

  30. #350
    PowerPoster ChrisE's Avatar
    Join Date
    Jun 2017
    Location
    Frankfurt
    Posts
    2,121

    Re: Vb6 , the Future, and what I have discovered

    Quote Originally Posted by Niya View Post
    Thanks for the example.

    As for my thoughts. While it is a solution, compared to a LINQ based solution, that is far too verbose. But it's biggest weakness is that this ADO based solution is only suitable for use on data. LINQ can be used to query, filter and transform actual objects.
    Hi ,
    can you provide an example with the use of LINQ


    regards
    Chris
    to hunt a species to extinction is not logical !
    since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.

  31. #351
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    5,639

    Re: Vb6 , the Future, and what I have discovered

    Quote Originally Posted by ChrisE View Post
    Hi ,
    can you provide an example with the use of LINQ


    regards
    Chris
    Here's a very simple example:-
    vbnet Code:
    1. '
    2.     Public ReadOnly Property SelectedFiles As String()
    3.         Get
    4.             Return grdFiles.SelectedFiles.Select(Function(f) f.FullFilePath).ToArray
    5.         End Get
    6.     End Property

    The above is an example of a projection, sometimes called a transformation. grdFiles.SelectedFiles returns an array of objects. Each object represents a file. It contains information like its size, location, name etc. We want to return an array of strings, each containing only the full file path. So the above code projects the list of file objects into a list of strings.

    This is the equivalent code without LINQ:-
    vbnet Code:
    1. '
    2.     Public ReadOnly Property SelectedFiles2 As String()
    3.         Get
    4.             Dim files As String() = New String(grdFiles.SelectedFiles.Length - 1) {}
    5.  
    6.             For i = 0 To Me.SelectedFiles.Length - 1
    7.                 files(i) = grdFiles.SelectedFiles(i).FullFilePath
    8.             Next
    9.  
    10.             Return files
    11.         End Get
    12.     End Property
    Personally I find it more tedious to write that. I will if I have to. Done it for years but I much prefer the functional syntax since it allows me to do simple things like that very very quickly.
    Last edited by Niya; Feb 3rd, 2018 at 12:15 PM.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena


    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. -jmcilhinney

  32. #352
    PowerPoster
    Join Date
    Jun 2013
    Posts
    4,427

    Re: Vb6 , the Future, and what I have discovered

    Quote Originally Posted by Niya View Post
    As for my thoughts. While it is a solution, compared to a LINQ based solution, that is far too verbose.
    You didn't back-up your assumption (because that's all it is) with any code-example of your own Niya...

    I thought we had this covered, with two code-examples standing side-by-side already - here's the one from Sitten again:
    Code:
    Dim topTen = File.EnumerateLines(path)
                     .Select(AddressOf ParseCustomer)
                     .Where(Function(c) c.State = "TX")
                     .OrderBy(Function(c) c.Balance)
                     .Take (10)
    Here is the equivalent with current VB6 again:
    Code:
      Set MemDB = ImportCSVGenericallyInto("CustImport", PathToCSVFile)
      Set Rs = MemDB.GetTable("CustImport", "State='TX'", "Balance Asc Limit 10")
    The VB6-based equivalent has a lot of advantages over the LINQ-based stuff above as e.g.:
    - better performance
    - less, easier to grasp code (Intellisense providing you with the information about the Arguments in the above MemDB.GetTable)
    - result is available in a generic MultiColumn-Object, which can be directly bound to "a Grid-View" of other GUI-Objects

    Furthermore the VB6-example:
    1) does not break basic engieneering-rules
    2) it avoids unnecessary data-copying or transformations

    As for 1):
    This is the main-reason I don't like these "language-extensions which come from functional languages".
    Main-engineering-rules (thousands of years old, no need to "refine" or "better" them, because they are axioms:
    - Break complex things down into smaller parts which then do "the one thing they are specialized for, as good as possible".
    - (Re)build the more complex things by using (glueing) these smaller, specialized parts

    Translated to our "what needs to go into a language" discussion:
    - keep functional languages apart from "stateful languages with side-effects" (because their concepts are too different, each should do "their own thing, which they are good at" isolated from each other.
    .. (as for "side-effects or statefulness", one might read: https://en.wikipedia.org/wiki/Side_e...puter_science)

    So, when we accept that languages have their "domain" -> there is already a "domain-specific language" which is specialized for "organizing, filtering, ordering larger sets" -
    and that is SQL.
    An engineering-wise very good encapsulation for the SQL-language, is available with SQLite (a masterfully implemented C-lib, that follows "the engineering rules" to the letter) -
    offering its specialized functionality in the form of the usual "building block" in programming -> a library.

    So, if we want to stay true to the axioms of engineering, we have to:
    - avoid the inclusion of the concepts of functional languages (which are only strong in their own domain) into a stateful language (as e.g. VB6)
    - avoid the inclusion of the concepts of "Set-oriented languages" (as e.g. SQL) into our existing glue-language as well

    If we stick to that, and use "the bricks" which are specialized in their own domains over appropriate libraries,
    we will end up with - (or remain with):
    - an easier to learn "glue language" (which is not cluttered with keywords or concepts, foreign to its own domain)
    - better performance (by using the "specialists" over libraries)
    - easier to read code, which often needs less lines (as the above example shows already)

    Quote Originally Posted by Niya View Post
    But it's biggest weakness is that this ADO based solution is only suitable for use on data.
    LINQ can be used to query, filter and transform actual objects.
    And here is exactly, where the above point #2 comes in ("avoid unnecessary data-copying or transformations"):

    I've already tried to explain, how LINQ-extensions (in a stateful-language) already break existing engineering-rules,
    so let's focus on your: "used to query, filter and transform actual objects".

    Your "actual objects" do not come "out of nowhere" - e.g. if we look at the "c As Customer"-Object in Sittens example,
    this needed to be:
    - defined in your "UserCode" specifically (in a Class-Module)
    - and then in addition: populated (with data over a Parsing-Function)

    My question to you - where does all this data come from, which you populate all your "specific UserObjects with"?
    Next question would be: "Do you need such specific UserCode-defined, primarily Data-encapsulating Objects at all"?

    Followed by... If we talk about "primarily Data-encapsulating, specific UserObjects":
    - wouldn't it be better to use generic MultiColumn-Objects for Data-encapsulation? (as they are delivered from "DB-Adapters" directly)?
    - thus avoiding the unnecessary step, of "copying data-over, for a second-time"?
    This way allowing:
    - direct Bindings to your GUI-View-Widgets which already understand such an "universal Container"
    - passing those "universal and well-known" Containers around across library-boundaries (libs, which do not know anything about your specific CustomerObject, but all about the universal container)

    So, given all of the above - do you understand a bit better, that most of the "new invented stuff" is just "unnecessary clutter" -
    and that the problems all this new stuff tries to "solve", was already solved decades ago (in a way better performing approach,
    which followed basic engineering-rules, and not "breaking them")?

    That's the sole reason why I come across as "always so damned sure" (that you cannot provide better code-examples, when you promote "the fancy-stuff") -
    it's simply not possible with tools and approaches, that broke basic engineering-rules.

    Olaf

  33. #353
    PowerPoster
    Join Date
    Jun 2013
    Posts
    4,427

    Re: Vb6 , the Future, and what I have discovered

    Quote Originally Posted by Niya View Post
    Here's a very simple example:-
    Code:
    Public ReadOnly Property SelectedFiles As String()
      Get
        Return grdFiles.SelectedFiles.Select(Function(f) f.FullFilePath).ToArray
      End Get
    End Property
    The above is an example of a projection, sometimes called a transformation.
    grdFiles.SelectedFiles returns an array of objects.
    Each object represents a file.
    Yep, that's exactly the thing I was trying to address in my prior post.
    If you'd have your "Grid" above "bound" to a "generic DataSource" as e.g. a Recordset (and not a "List of specific FileObjects"),
    and then return (in your grdFiles.SelectedFiles-method) just another SubSet of your bound Recordset (also being of type Recordset).

    you could...
    Quote Originally Posted by Niya View Post
    We want to return an array of strings, each containing only the full file path.
    So the above code projects the list of file objects into a list of strings.
    ...entirely avoid any transformations (the already mentioned, unnecessary Data-Copying) -
    by just passing the result of grdFiles.SelectedFiles along (in a generically usable Container-Object,
    which is already understood "interface-wise" by a whole lot of "other methods in your workflow" -
    even by external libraries (which know the "generic type", but not your "special one").

    The reason why you feel the need for a "String-Array" conversion, is in all likelihood caused by
    the problem, that you (currently) cannot pass the "SubList of FileObjects along, directly as it is" -
    because it is *not* understood currently by other Method-Signatures in your workflow, who have no
    knowledge about the interface of your "FileObject"-Class.

    Olaf

  34. #354
    PowerPoster ChrisE's Avatar
    Join Date
    Jun 2017
    Location
    Frankfurt
    Posts
    2,121

    Re: Vb6 , the Future, and what I have discovered

    Quote Originally Posted by Niya View Post
    Here's a very simple example:-
    vbnet Code:
    1. '
    2.     Public ReadOnly Property SelectedFiles As String()
    3.         Get
    4.             Return grdFiles.SelectedFiles.Select(Function(f) f.FullFilePath).ToArray
    5.         End Get
    6.     End Property

    The above is an example of a projection, sometimes called a transformation. grdFiles.SelectedFiles returns an array of objects. Each object represents a file. It contains information like its size, location, name etc. We want to return an array of strings, each containing only the full file path. So the above code projects the list of file objects into a list of strings.

    This is the equivalent code without LINQ:-
    vbnet Code:
    1. '
    2.     Public ReadOnly Property SelectedFiles2 As String()
    3.         Get
    4.             Dim files As String() = New String(grdFiles.SelectedFiles.Length - 1) {}
    5.  
    6.             For i = 0 To Me.SelectedFiles.Length - 1
    7.                 files(i) = grdFiles.SelectedFiles(i).FullFilePath
    8.             Next
    9.  
    10.             Return files
    11.         End Get
    12.     End Property
    Personally I find it more tedious to write that. I will if I have to. Done it for years but I much prefer the functional syntax since it allows me to do simple things like that very very quickly.
    Hi Niya,

    I meant a sample with LINQ regarding ... get Top Ten from CSV-File.

    regards
    Chris
    to hunt a species to extinction is not logical !
    since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.

  35. #355
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    5,639

    Re: Vb6 , the Future, and what I have discovered

    @Olaf

    There are a couple things I would like to address in your posts but I'm going to be a bit busy in a while. I don't have the time right now since there are a lot of things in your posts to digest and I don't want to gloss over it and give a hurried answer. I'll get back to that a little later when I'm free.

    However, for now I'd like to side step the engineering debate and state that all you would have to do at minimum, is support delegates and higher order functions in your compiler. That is literally all that would be needed and most importantly, it wouldn't violate the main goal of being backward compatible with VB6. People like me, who don't mind one bit about mixing functional programming into a stateful design can produce our own version or subset of LINQ and purists like yourself can live happily ignoring it. Everybody wins. Why resist so strongly against something so simple? It's not like I'm suggesting you implement LINQ-like features yourself. Just give developers the option to do so.

    Quote Originally Posted by ChrisE View Post
    Hi Niya,

    I meant a sample with LINQ regarding ... get Top Ten from CSV-File.

    regards
    Chris
    Sitten already provided such an example which Olaf had addressed. I was trying to demonstrate how LINQ can solve a wider variety of problems.
    Last edited by Niya; Feb 3rd, 2018 at 05:05 PM.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena


    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. -jmcilhinney

  36. #356
    Frenzied Member wqweto's Avatar
    Join Date
    May 2011
    Posts
    1,603

    Re: Vb6 , the Future, and what I have discovered

    https://github.com/wqweto/VbPeg

    FYI, just released the first public version of VbPeg - a simple PEG parser generator for VB6.

    Reached important milestone this weekend -- the parser generator is self-hosted. Meaning that it can produce it's own parser code (look at the quality of the auto-generated code) from a PEG grammar and then the second generation produces exactly the same parser.

    There are some bugs currently and the project will be in flux shortly but decided to share early with all of you language enthusiasts here :-))

    This project is based on Ian Piumarta's work on peg/leg project but is a complete rewrite (obviously in VB6). The completely new thing is the rudimentary Intermediate Representation (IR) on which final codegen based.

    Early on I decided that VB6 compiler wouldn't let me get away with redundant variables, preprocessor hacks that Ian's peg/leg codegen is littered. Yet most of the useful optimizations came from the initial Parse Tree processing, the latter IR pruning is next to non-existent (yet) -- this is not a full-blown compiler.

    I plan to extend the syntax based on PEG.js work, including named/table captures. Case-insensitivity is a priority too as I'm currently aiming at producing a simple VBScript interpreter and then a more complex VBScript-to-C transpiler -- both generous IDispatch consumers with minimal run-time. Classes support in these VBScript spin-offs will prototype COM interfaces implementation, e.g. passing instances of these as callbacks to VB6 Ax-DLLs, etc.

    Btw, Olaf's .bas/.cls only VB6 successor is very close to a similar VBScript implementation.

    cheers,
    </wqw>
    Last edited by wqweto; Feb 5th, 2018 at 07:24 AM.

  37. #357
    PowerPoster
    Join Date
    Jun 2015
    Posts
    2,224

    Re: Vb6 , the Future, and what I have discovered

    well shoot. nicely done.

  38. #358
    Junior Member
    Join Date
    Jan 2011
    Posts
    16

    Re: Vb6 , the Future, and what I have discovered

    I just came across this thread, and I have to say, it feels as though an old wound has just been opened.

    I have a quite complex object model under the hood of my primary project. Some objects represent real-world objects which have appearances, and it would be the icing on the cake if I could store and reproduce those images in my app.

    I discovered rc5 a few years ago. I believe Olaf might have seen my plea for help, perhaps in this forum, and suggested I look at it. So that's what I did.

    Dealing with graphics, at least by using the facilities currently available to me is not something which I find intuitive, and I consider myself a newbie. I found the rc5 tutorials to be quite confusing, and had a period of direct correspondence with Olaf to try to clarify things.

    Wel, I think I unintentionally upset Olaf by something I said on here, which was taken the wrong way. It was simply that I felt the level of support for rc5 was somewhat lacking, in not having clear and full documentation, such that a mere developer like me could get up-and-running with it quickly.

    Reading through some of this thread, I am reminded of the difficulties I had in correspondence with Olaf. My German is nowhere near as good as his English, and I can't complain about the language difficulty since Olaf has at least made an effort to explain things in a language which is not his own. However I find his explanations confusing, sometimes ambiguous, and rather difficult to follow. I was getting nowhere.

    If there could be a clear and concise explanation of how to use rc5 *written by an English-speaker* I would be more than happy to invest more time in it. I've seen what the tutorial examples are capable of, and I'd really like to use graphics like that in my app. "RC5 for Dummies" might be a good start. Is one of the 'thousands' of rc5 developers out there willing to produce something?

    For my own purposes, I thing rc5 is too all-encompassing, and could be split into smaller chunks. All I need is a graphics library. The other features of rc5 may well be far superior to their vb6 equivalents, however vb6 does the job so why risk breaking it?

  39. #359
    Fanatic Member
    Join Date
    Dec 2014
    Posts
    828

    Re: Vb6 , the Future, and what I have discovered

    Im with GJChurchward, RC5 is not that intuitive and take effort to learn. without good examples and the feelings "i most have this" its easier to use a well known method instead.
    smaller chunks is what i wrote in another post, and in another post i wrote "plugins".
    what i mean is, its better to have many smaller dlls than 1 big, so if i need database, i pick the database dll, if i need widgets i take that, and so on.
    that will also increase people using the RC5, now that we have alternatives to everything, but still optimized for just the purpose we need.

    in another post i read: what is faster, and we got RC5/Cairo in 2nd place. its a good candidate if its "easy" to use, otherwise why bother? its not that we "need" to use RC5 at the moment right? GDI is still working and will for many years if not decades.
    to make RC5 replace GDI, it need to be a attractive enough. right now its not. i read that we need to "help each other" for the future of VB6, so i need to "adapt", but why not RC5 try to adapt to us as well?

    it would take me weeks to convert my code to RC5. is that something i want to do without even knowing it will give me better performance? i dont even know where to start, i dont know how to convert my code to RC5.

    also, RC5/Cairo is still cpu only rendering or gpu as well?

    also, RenderSurfaceContent will take the whole picture and squeeze it inside the rectangle, what about copy an area in the source picture and paste it in the desire area in destination?

    edit: after some "testing", and after i was forced to "convert" the example, here is what i figure out:
    Code:
    Public RC5 As New cConstructor
    Public Cairo As cCairo
    Public Context As cCairoContext
    Public Surface As cCairoSurface
    
    Set Cairo = RC5.Cairo
    Set Surface = Cairo.CreateSurface(400, 200)
    Set Context = Surface.CreateContext
    Cairo.ImageList.AddImage "1", App.Path & "\data\a picture.png"
    Context.Save < what is this?
    Context.RenderSurfaceContent "1", 0, 0, 400, 200
    Context.Restore < and this?
    Surface.DrawToDC form1.hDC
    i mean, this is the kind of example i want/need, very simple and do 1 thing only. still theres questions, as what is Save and Restore and how to use RenderSurfaceContent similar to gdi.
    Last edited by baka; Feb 5th, 2018 at 01:10 PM.

  40. #360
    Frenzied Member
    Join Date
    Sep 2012
    Posts
    1,682

    Re: Vb6 , the Future, and what I have discovered

    Quote Originally Posted by Schmidt View Post
    Code:
    Dim As Integer a, b, c  '<- all of these symbols would be recognized as 16Bit-Integers
    
    'alternatively, with Initializers:
    Dim As Integer a=1, b=2, c=3  '<- all of these symbols would be recognized as 16Bit-Integers, initialized with the values 1, 2, 3
    
    'alternatively, also with Initializers, but explicit Type-assignments again (as used to) for each single symbol-name:
    Dim a As Integer = 1, b As Integer = 2, c As Integer = 3 [COLOR=#008000] '<- explicitely typed 16Bit-Integers[COLOR=#008000], initialized with the values 1, 2, 3
    I like it. Perhaps the following is also an option:
    Code:
    Dim (a, b, c) as Integer
    My suggestion to Olaf's new compiler and IDE is this:

    • Don't add any syntax-sugars in Version1 and Version2
    • In Version1 and Version2 only consider .bas and .cls, don't consider UI
    • When the Version1 or Version2 is stabilized, then consider adding the UI part to Version3, as well as adding some syntax-sugars.
    • Consider including a script language similar to TypeScript.
    • Extensive support for Web development and Mobile development
    • Since Golang is called Web-Basic and Web-C++, Golang has many good things that we can learn from, such as simple and efficient concurrent-processing, functions that allow multiple return values, and error-handling.


    IMO, the new compiler and IDE should be a combination of Web-Basic and VisualBasic(64-bit, platform-independent), which may be called VisualWebBasic.

    Edit:

    Perhaps the new Compiler and IDE can be divided into two levels:

    • Core-Level: NewBasic-Core (no UI, support for new syntax-sugar, efficient concurrent-processing, simple IDE, closed-source)
    • Application-Level: NewBasic-Visual IDE (modern UI, less syntax-sugars, rich-IDE, open-source)


    Note: NewBasic-Visual IDE calls NewBasic-Core at the bottom, meaning that the NewBasic-Visual IDE was developed by NewBasic-Core.
    Last edited by dreammanor; Feb 5th, 2018 at 11:59 PM.

Page 9 of 13 FirstFirst ... 6789101112 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width