Page 12 of 46 FirstFirst ... 2910111213141522 ... LastLast
Results 441 to 480 of 1810

Thread: TwinBasic

  1. #441
    New Member
    Join Date
    Aug 2021
    Posts
    4

    Re: TwinBasic work with Version of Projekt

    Hello,
    I primly work with MS-Access. If I want to try out something, I make a copy of the file.
    I'm not familiar with Source-Control etc. jet.
    What is the recommended way to work with Tb Versions of a project?
    Thanks for useful links, to learn with.
    Last edited by getgrowing; Sep 1st, 2021 at 10:36 AM.

  2. #442
    Fanatic Member
    Join Date
    Feb 2015
    Posts
    1,023

    Re: TwinBasic

    twinBASIC status update:

    https://nolongerset.com/twinbasic-up...tember-5-2021/

    Highlights include IntelliSense in the Debug Console, unit testing improvements, and the addition of #Error and #Warning directives.

  3. #443
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,421

    Re: TwinBasic

    JavaScript has a comma operator, for example:
    Code:
    if (a, b, c, d) { 
        ... 
        ...
        return e, f, g, h;
    }
    Maybe twinBasic could add a similar operation, that is, use a colon instead of the comma operator, for example:
    Code:
    If (a: b: c: d) Then
    ...
    ...
    End If
    The above is equivalent to:
    Code:
    Call a
    Call b
    Call c
    
    If d Then
    ...
    ...
    End If

  4. #444
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,871

    Re: TwinBasic

    What an odd syntax, can lead to a lot of confusion

  5. #445
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,421

    Re: TwinBasic

    Quote Originally Posted by Arnoutdv View Post
    What an odd syntax, can lead to a lot of confusion
    The part is a bit confusing, but the whole is clearer.

    Most syntactic sugar is more confusing for beginners, but once they are familiar and used to these syntactic sugars, they seem to rely more and more on syntactic sugar.
    Last edited by SearchingDataOnly; Sep 10th, 2021 at 03:49 AM.

  6. #446
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,458

    Re: TwinBasic

    Quote Originally Posted by SearchingDataOnly View Post
    The part is a bit confusing, but the whole is clearer.

    Most syntactic sugar is more confusing for beginners, but once they are familiar and used to these syntactic sugars, they seem to rely more and more on syntactic sugar.
    VB.Net has a similar idea using Tuples behind the scenes
    Code:
    Imports System.Globalization
    
    Public Module NumericLibrary
        Public Function ParseInteger(value As String) As (Success As Boolean, Number As Int32)
            Dim number As Integer
            Return (Int32.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, number), number)
        End Function
    End Module
    That snippet is from https://docs.microsoft.com/en-us/dot...-return-values

  7. #447
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,421

    Re: TwinBasic

    Quote Originally Posted by PlausiblyDamp View Post
    VB.Net has a similar idea using Tuples behind the scenes
    Code:
    Imports System.Globalization
    
    Public Module NumericLibrary
        Public Function ParseInteger(value As String) As (Success As Boolean, Number As Int32)
            Dim number As Integer
            Return (Int32.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, number), number)
        End Function
    End Module
    That snippet is from https://docs.microsoft.com/en-us/dot...-return-values
    VB.NET has a lot of excellent syntactic sugar. Although I will never use VB.NET, I have been absorbing some valuable syntax from VB.NET syntactic sugar.

    However, the tuple of VB.NET and the comma operator of JS are completely different concepts, and their uses are also completely different.

    Code:
    if (a, b, c, d) { 
        ... 
        ...
        return e, f, g, h;
    }
    The above is equivalent to:
    Code:
    a;
    b;
    c;
    if (d){
        ...
        ...
        e;
        f;
        g;
        return h;
    }
    Since a, b, c, d are a group of closely related statements/expressions, putting them in parentheses makes the whole code block clearer: (a, b, c, d)

    Similarly, e, f, g, and h are also a group of closely related statements/expressions, so they are also placed in the parentheses: (e, f, g, h)
    Last edited by SearchingDataOnly; Sep 10th, 2021 at 05:01 AM.

  8. #448
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,871

    Re: TwinBasic

    Hmmm.
    I often use the following construct in VB6
    Code:
    Public Function myFunction(lInput As Long, sInput As String, ByRef lReturnValue1 As Long, ByRef sReturnValue2 As String) As Boolean
      ' Bla bla
    End Function
    Last edited by Arnoutdv; Sep 10th, 2021 at 06:31 AM.

  9. #449
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,415

    Re: TwinBasic

    Quote Originally Posted by Arnoutdv View Post
    Hmmm.
    I often use the following construct in VB6
    Code:
    Public Function myFunction(lInput As Long, sInput As Long, ByRef lReturnValue1 As Long, ByRef sReturnValue2 As String) As Boolean
      ' Bla bla
    End Function
    I use that too.
    It's basically the way the C-WinApi is designed: return the result in a Reference, and the function-result is some kind of error-code.

    Arnout, for clarity's sake: Your first two arguments should be ByVal! (Not implicit ByRef as it's now)
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  10. #450
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,871

    Re: TwinBasic

    I know, if you don't specify ByVal or ByRef the default is ByRef :-)

  11. #451
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,988

    Re: TwinBasic

    I don't see the value of the comma separator. Seems more likely to cause confusion than anything else.

    Still, if you want to load every kind of construct you can come up with into a language, why not just use C#?
    My usual boring signature: Nothing

  12. #452
    Fanatic Member
    Join Date
    Feb 2015
    Posts
    1,023

    Re: TwinBasic

    twinBASIC update:

    https://nolongerset.com/twinbasic-up...ember-12-2021/

    Highlights include VS Code Extensibility, RGB extraction functions, dropping Finalize(), and a discussion regarding potential typedef support.

  13. #453
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: TwinBasic

    Quote Originally Posted by VB6 Programming View Post
    twinBASIC update:

    https://nolongerset.com/twinbasic-up...ember-12-2021/

    Highlights include VS Code Extensibility, RGB extraction functions, dropping Finalize(), and a discussion regarding potential typedef support.
    Nice update.

    The conversation on typedef support was rather interesting. However, I think it's a bad idea, not because of any technical demerit but simply because I don't think this discussion takes into consideration undisciplined programmers. VB6 and BASIC in general tend to attract a lot of non-programmers that bring with them a serious lack of coding discipline. typedefs make it extremely easy to turn even the simplest programs into an unreadable mess. I really don't think something like this belongs in any BASIC language to be honest.
    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

    Copy/move files using Windows Shell | I'm not wanted

    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

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  14. #454
    Addicted Member
    Join Date
    Aug 2013
    Posts
    236

    Re: TwinBasic

    Quote Originally Posted by Niya View Post
    VB6 and BASIC in general tend to attract a lot of non-programmers that bring with them a serious lack of coding discipline.
    I think that's a moot point today
    I'd have thought that Python would have long since become the destination of choice for non-programmers looking to do a bit of coding.
    And try dabbling in vb.net these days and you get very little assistance. All the microsoft examples are in c#.
    In my brief experience it looks harder to find help for vb.net than vb6
    What newbie is going to choose vb.net over c# in those circumstances?

  15. #455
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: TwinBasic

    Quote Originally Posted by vbrad View Post
    I think that's a moot point today
    I'd have thought that Python would have long since become the destination of choice for non-programmers looking to do a bit of coding.
    And try dabbling in vb.net these days and you get very little assistance. All the microsoft examples are in c#.
    In my brief experience it looks harder to find help for vb.net than vb6
    What newbie is going to choose vb.net over c# in those circumstances?
    You might be right. Who knows. All I know is something as powerful typedef needs to be used responsibly. People who come from unforgiving programming backgrounds like C++ tend to be very respectful of it's power. Perhaps it might be good for TwinBASIC, I don't know. I'm not really leaning hard one way or another. It's just that my first instinct is that it doesn't belong in BASIC. I could be wrong. I guess we'll see what happens.
    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

    Copy/move files using Windows Shell | I'm not wanted

    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

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  16. #456
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: TwinBasic

    @Niya,
    everything can be mis-used. The typedef is like a UDT, just shortcut like. (direct)

  17. #457
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,415

    Re: TwinBasic

    Quote Originally Posted by Niya View Post
    You might be right. Who knows. All I know is something as powerful typedef needs to be used responsibly. People who come from unforgiving programming backgrounds like C++ tend to be very respectful of it's power. Perhaps it might be good for TwinBASIC, I don't know. I'm not really leaning hard one way or another. It's just that my first instinct is that it doesn't belong in BASIC. I could be wrong. I guess we'll see what happens.
    I'm of two minds about TypeDefs:
    Reading C-Code it drives me up the walls trying to figure out, what's the "original" type.
    Not knowing any better, i think TypeDefs in C were invented because C-Programmers are lazy buggers :-)

    OTOH, the example on the page linked to above, defining SubSets of Types is intriguing, so a MyWindow=MyMenu shouldn't compile despite being the same base-type
    Last edited by Zvoni; Sep 14th, 2021 at 02:35 AM.
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  18. #458
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: TwinBasic

    Quote Originally Posted by Niya View Post
    It's just that my first instinct is that it doesn't belong in BASIC.
    Like for example, "anonymous functions"?

    Olaf

  19. #459
    Fanatic Member 2kaud's Avatar
    Join Date
    May 2014
    Location
    England
    Posts
    996

    Re: TwinBasic

    because C-Programmers are lazy buggers :-)
    Quite right and c++ ones are worse! Why type begin when you can use { and end instead of } Why use int when you could use I or D instead of double. Typing just gets in the way of coding. Come to think of it, why not just use APL...
    All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  20. #460
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,415

    Re: TwinBasic

    IMO, TypeDefs only make sense if you're supposed to code Cross-Platform and/or cross-bitness, to write your code only once.

    along the lines of
    Code:
    #If Win64 Then
    Public Type APointer As UInt64
    #Else
    Public Type APointer As UInt32
    #End If
    
    Public Function GetPointer As APointer
    'Bla
    End If
    EDIT: And even this (conditional compilation) is subject to discussion, if this shouldn't be handled by the IDE, say, the chosen compile-target
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  21. #461
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: TwinBasic

    Quote Originally Posted by Krool View Post
    @Niya,
    everything can be mis-used. The typedef is like a UDT, just shortcut like. (direct)
    Like I said, it was just my instinct. The issue of whether typedefs should be included in a BASIC language is not one I'm prepared to go to war over. I'm fine with them being included. They are powerful and when used right can really improve productivity. But it's just so scary to think about how easily they can be abused to create an unreadable mess.

    Quote Originally Posted by Schmidt View Post
    Like for example, "anonymous functions"?

    Olaf
    A script kiddie just learning the power of programming could do a lot more damage with typedefs than anonymous functions.
    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

    Copy/move files using Windows Shell | I'm not wanted

    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

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  22. #462
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: TwinBasic

    Quote Originally Posted by Zvoni View Post
    i think TypeDefs in C were invented because C-Programmers are lazy buggers :-)
    Errr...not so fast. They are a great feature when used with discipline. I've grown to appreciate them over the years because of it's usage in the Win32 API. They can make things a lot easier to understand when used properly.

    For example, take HWND and HBITMAP. Both these things are nothing more than a HANDLE typedef which in turn is a typedef for a void pointer(void*) . This means that both HWND and HBITMAP are just ordinary pointers. But when you encounter HWND while reading a piece of code, you immediately know what is expected, in this case, a handle to a window. Without typedefs, you would have void* all over the place and you could never be sure if a certain function expects a handle to a window or a bitmap. Typedefs can help make it much easier reason about what a piece of code is doing because of the extra information it provides to the one reading the code. Without typedefs, the only other way to do this would be to use classes and structures which are both good options but sometimes it's overkill. Typedefs allow you a way to create new types without actually creating new types which is an incredibly efficient way of solving this problem.

    The thing is, it's extremely easy to abuse and if one is not careful, it can make code thoroughly unreadable. It could very well be the most destructive feature ever conceived in the world of programming when used improperly. It requires incredible discipline to use this effectively in a large codebase. The Microsoft guys are very disciplined and still, it sometimes feel like a chore trying to decipher typedefs in their C++ header files. Typedefs are not a feature to treat lightly.
    Last edited by Niya; Sep 14th, 2021 at 07:45 AM.
    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

    Copy/move files using Windows Shell | I'm not wanted

    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

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  23. #463
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,415

    Re: TwinBasic

    Quote Originally Posted by Niya View Post
    Errr...not so fast. They are a great feature when used with discipline. I've grown to appreciate them over the years because of it's usage in the Win32 API. They can make things a lot easier to understand when used properly.

    For example, take HWND and HBITMAP. Both these things are nothing more than a HANDLE typedef which in turn is a typedef for a void pointer(void*) . This means that both HWND and HBITMAP are just ordinary pointers. But when you encounter HWND while reading a piece of code, you immediately know what is expected, in this case, a handle to a window. Without typedefs, you would have void* all over the place and you could never be sure if a certain function expects a handle to a window or a bitmap. Typedefs can help make it much easier reason about what a piece of code is doing because of the extra information it provides to the one reading the code. Without typedefs, the only other way to do this would be to use classes and structures which are both good options but sometimes it's overkill. Typedefs allow you a way to create new types without actually creating new types which is an incredibly efficient way of solving this problem.

    The thing is, it's extremely easy to abuse and if one is not careful, it can make code thoroughly unreadable. It could very well be the most destructive features ever conceived in the world of programming when used improperly. It requires incredible discipline to use this effectively in a large codebase. The Microsoft guys are very disciplined and still, it sometimes feel like a chore trying to decipher typedefs in their C++ header files. Typedefs are not a feature to treat lightly.
    Hmm, OK, agreed. Haven't looked at it from that POV, since i've never programmed a single line in C or C++.
    And you're probably right with discipline at Microsoft.
    But since i'm reading (!!) a lot of C-Code (No MS-Code --> writing bindings for custom c-lib in Pascal), it just annoys the hell out of me, when i have to ask "is that an Integer, an unsigned Integer or what?"
    And let's not talk about hungarian notation ad nauseum

    Yes, everything in life works effectively, if you apply discipline to it.
    I'm a skydiver. With no discipline i'd just burn a whole into the sky, and be a danger to me and others
    Christiano Ronaldo became the best footballer of the world with what? Correct, discipline.

    The problem is, that a lot of people try to use shortcuts, and leave a mess behind.
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  24. #464
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: TwinBasic

    Yep. That's pretty much it.

    Quote Originally Posted by Zvoni View Post
    Haven't looked at it from that POV, since i've never programmed a single line in C or C++.
    You can benefit from it without having to use C/C++ if you ever use Win32 extensively. The most common examples you'd encounter is API functions that take strings. When you see LPWSTR, you immediately know you're expected to pass a pointer to a UTF-16 string. If you see LPSTR, you know immediately that an ANSI string is expected and if you see LPTSTR, you know that the expected string is ANSI if you're on any Windows pre-XP and UTF-16 on any NT based Windows. All of these typedefs boil down to a char*. If this were used instead, all you would know is that a pointer to a character array is expected. Unless explicitly written somewhere, you'd never know what kind of character array is expected.
    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

    Copy/move files using Windows Shell | I'm not wanted

    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

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  25. #465
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,988

    Re: TwinBasic

    Quote Originally Posted by vbrad View Post
    I think that's a moot point today
    I'd have thought that Python would have long since become the destination of choice for non-programmers looking to do a bit of coding.
    And try dabbling in vb.net these days and you get very little assistance. All the microsoft examples are in c#.
    In my brief experience it looks harder to find help for vb.net than vb6
    What newbie is going to choose vb.net over c# in those circumstances?
    That may just be you, actually. For some reason, I tend to find VB.NET examples even when looking for C#. MS tends to put out both, often on tabbed pages, but I wonder if Google doesn't have a hand in the search results you and I are getting?
    My usual boring signature: Nothing

  26. #466
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: TwinBasic

    Here's a thing I got reminded of when I came across this thread. Asynchronous methods. Has there been any discussion about whether asynchronous methods will be implemented in TwinBASIC?

    Not only do they exist in .Net(VB and C#), they are also implemented in many languages including Python and JavaScript. Async/Await has become quite a popular paradigm over the last decade and I think their inclusion in TwinBASIC is a very important discussion to be had. And they can be included without breaking compatibility with VB6 in any way.
    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

    Copy/move files using Windows Shell | I'm not wanted

    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

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  27. #467
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: TwinBasic

    Quote Originally Posted by Niya View Post
    Here's a thing I got reminded of when I came across this thread. Asynchronous methods. Has there been any discussion about whether asynchronous methods will be implemented in TwinBASIC?

    Not only do they exist in .Net(VB and C#), they are also implemented in many languages including Python and JavaScript. Async/Await has become quite a popular paradigm over the last decade and I think their inclusion in TwinBASIC is a very important discussion to be had. And they can be included without breaking compatibility with VB6 in any way.
    Yes there is a open issue in GitHub for that.
    https://github.com/WaynePhillipsEA/twinbasic/issues/173

  28. #468
    Addicted Member
    Join Date
    Aug 2013
    Posts
    236

    Re: TwinBasic

    Quote Originally Posted by Shaggy Hiker View Post
    That may just be you, actually. For some reason, I tend to find VB.NET examples even when looking for C#. MS tends to put out both, often on tabbed pages, but I wonder if Google doesn't have a hand in the search results you and I are getting?
    That could well be it because I never look for vb.net stuffn normally. But i have been playing around with it a bit recently
    making great progress NOT!

    As an example, the following shell command works in vb6 but not in vb.net and I've no idea why

    Code:
            Dim s As String
            s = """C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.EXE"" ""C:\test folder\Project1.Vbp"""
    
            'VB.NET (2008)
            Shell(s, AppWinStyle.MaximizedFocus) 'System.IO.FileNotFoundException was unhandled
            
            'VB6
            Shell s, vbMaximizedFocus  'works

  29. #469
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,458

    Re: TwinBasic

    Quote Originally Posted by vbrad View Post
    That could well be it because I never look for vb.net stuffn normally. But i have been playing around with it a bit recently
    making great progress NOT!

    As an example, the following shell command works in vb6 but not in vb.net and I've no idea why

    Code:
            Dim s As String
            s = """C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.EXE"" ""C:\test folder\Project1.Vbp"""
    
            'VB.NET (2008)
            Shell(s, AppWinStyle.MaximizedFocus) 'System.IO.FileNotFoundException was unhandled
            
            'VB6
            Shell s, vbMaximizedFocus  'works
    Does the exception have any detail in it's error message or inner exception as to which file wasn't found?

    Also. Net has the Process class amongst others to make launching external applications a lot easier.

  30. #470
    Addicted Member
    Join Date
    Aug 2013
    Posts
    236

    Re: TwinBasic

    Quote Originally Posted by PlausiblyDamp View Post
    Does the exception have any detail in it's error message or inner exception as to which file wasn't found?

    Also. Net has the Process class amongst others to make launching external applications a lot easier.
    Hi PD, thanks for your interest.
    The "inner exception:" was empty and no mention of a file name that i could see, (both are present).
    The following strings with no arguments also failed with the same exception and with no inner exception text, if that suggests anything.

    Code:
    s = "C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.EXE"
            s = """C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.EXE"""
            Shell(s, AppWinStyle.MaximizedFocus)
    I think I got Process.start() to work at some point but it simply ignored the Command string argument, ie it just opened VB6 with no project selected.

    Maybe it's a vb2008 thing?

  31. #471
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: TwinBasic

    Those old VB6 style things like Shell was provided to make VB6 programmers feel more comfortable with .Net but makes no mistake, doing things that way is strongly discouraged in VB.Net. I'm not surprised that fails for some unknown reason. Process.Start is the way to go.

    Quote Originally Posted by Krool View Post
    Yes there is a open issue in GitHub for that.
    https://github.com/WaynePhillipsEA/twinbasic/issues/173
    Ah ok.
    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

    Copy/move files using Windows Shell | I'm not wanted

    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

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  32. #472
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,988

    Re: TwinBasic

    So...now this thread has wandered into VB.NET???
    My usual boring signature: Nothing

  33. #473
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: TwinBasic

    Quote Originally Posted by Shaggy Hiker View Post
    So...now this thread has wandered into VB.NET???
    A lot of TwinBASIC features, both suggested and implemented, are inspired by VB.Net. Generics even use the exact same syntax.
    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

    Copy/move files using Windows Shell | I'm not wanted

    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

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  34. #474
    Addicted Member
    Join Date
    Aug 2013
    Posts
    236

    Re: TwinBasic

    Quote Originally Posted by Niya View Post
    Those old VB6 style things like Shell was provided to make VB6 programmers feel more comfortable with .Net but makes no mistake, doing things that way is strongly discouraged in VB.Net. I'm not surprised that fails for some unknown reason. Process.Start is the way to go.
    Yes but pasting "C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.EXE" "C:\test folder\Project1.Vbp" into cmd.exe, works too!
    So VB6 and the Windows 10 command line work but vb.net fails?

    EDIT:
    Process.Start worked in both the following formats:
    Code:
    Process.Start("""C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.EXE""", """C:\test folder\Project1.Vbp""")
    'and
    Process.Start("C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.EXE", """C:\test folder\Project1.Vbp""")
    It failed if I did not wrap the arguments parameter in double quotes because of the space in the address.
    It worked with or without the extra double quotes in the firat parameter.

    Anyway I'll leave it there, sorry for sidetracking the conversation.
    Last edited by vbrad; Sep 17th, 2021 at 12:03 AM.

  35. #475
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: TwinBasic

    To be honest, I couldn't tell you why that fails because in my opinion it would just be a waste of time trying to figure out why since using the Process class is the way to go. When I first moved to VB.Net from VB6, I only used those old VB6 things for like a week or two before I learned to do things the .Net way. There are probably all kinds of bugs and quirks in this old VB6 compatibility namespace.
    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

    Copy/move files using Windows Shell | I'm not wanted

    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

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  36. #476
    Addicted Member
    Join Date
    Aug 2013
    Posts
    236

    Re: TwinBasic

    Quote Originally Posted by Niya View Post
    To be honest, I couldn't tell you why that fails because in my opinion it would just be a waste of time trying to figure out why since using the Process class is the way to go. When I first moved to VB.Net from VB6, I only used those old VB6 things for like a week or two before I learned to do things the .Net way. There are probably all kinds of bugs and quirks in this old VB6 compatibility namespace.
    Actually I don't know that it is a member of the VB6 compatibility namespace. I think it's part of core vb.net if that makes sense and looking at the intellisense just now (sorry!) it doesn't mention accepting arguments in its path whereas the target path in the vb6 function can include arguments.

  37. #477
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: TwinBasic

    Quote Originally Posted by vbrad View Post
    Actually I don't know that it is a member of the VB6 compatibility namespace.
    It's fully qualified name is Microsoft.VisualBasic.Interaction.Shell(). The Microsoft.VisualBasic namespace is provided for compatibility with VB6. You will find all of the VB6 stuff in that namespace and it's use is not recommended for development. It was only provided to make migration of code from VB6 to VB.Net less of a chore, though it failed in this regard since the differences between VB6 and VB.Net goes far beyond what is contained in that namespace alone.
    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

    Copy/move files using Windows Shell | I'm not wanted

    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

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  38. #478
    Fanatic Member
    Join Date
    Feb 2015
    Posts
    1,023

    Re: TwinBasic

    twinBASIC status update:

    https://nolongerset.com/twinbasic-up...ember-19-2021/

    Highlights include discussions around block scoping and a planned ObjRefCount() function.


  39. #479
    Addicted Member
    Join Date
    Aug 2013
    Posts
    236

    Re: TwinBasic

    Quote Originally Posted by Niya View Post
    It's fully qualified name is Microsoft.VisualBasic.Interaction.Shell(). The Microsoft.VisualBasic namespace is provided for compatibility with VB6. You will find all of the VB6 stuff in that namespace and it's use is not recommended for development. It was only provided to make migration of code from VB6 to VB.Net less of a chore, though it failed in this regard since the differences between VB6 and VB.Net goes far beyond what is contained in that namespace alone.
    Thanks Niya, I stand corrected (The reason why I'd thought it might not have been was because I hadn't put in any import statements but it had still worked).

  40. #480
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: TwinBasic

    Quote Originally Posted by vbrad View Post
    (The reason why I'd thought it might not have been was because I hadn't put in any import statements but it had still worked).
    Well remember, Microsoft wanted VB6 developers to use VB.Net instead so the extra hassle of having to import it might have been off-putting which is why it is imported by default. They wanted to make the transition as easy as possible. It worked in my case. It made it very easy for me to transition from VB6 to VB.Net and gave me something to rely on until I learned how to do things "the .Net way".
    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

    Copy/move files using Windows Shell | I'm not wanted

    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

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

Page 12 of 46 FirstFirst ... 2910111213141522 ... 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
  •  



Click Here to Expand Forum to Full Width