Results 1 to 39 of 39

Thread: [RESOLVED] Why can't Enum of VB6 be a string?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2020
    Posts
    447

    Resolved [RESOLVED] Why can't Enum of VB6 be a string?

    Why can't Enum of VB6 be a string?

    Code:
    Public Enum MyFlags
        AAA = "AAAAAA"
        BBB = "BBBBBB"
        CCC = "CCCCCC"
    End Enum

  2. #2
    Frenzied Member PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Newport, UK
    Posts
    1,486

    Re: Why can't Enum of VB6 be a string?

    Quote Originally Posted by SearchingDataOnly View Post
    Why can't Enum of VB6 be a string?

    Code:
    Public Enum MyFlags
        AAA = "AAAAAA"
        BBB = "BBBBBB"
        CCC = "CCCCCC"
    End Enum
    An Enum is just an enumerated type, they are really nothing more than a numeric constant under the hood. The idea is that they make it easier to either auto assign numeric constants when you don't care about the actual numbers, or to group related constants together.

    Personally if I was dealing with a series of string constants I would probably just make a class to contain them all.

  3. #3
    Frenzied Member
    Join Date
    Jan 2020
    Posts
    1,627

    Re: Why can't Enum of VB6 be a string?

    YOU CAN MAKE A STRING ARRAY()
    Code:
    Public Enum MyFlags
        AAA
        BBB
        CCC
    End Enum
    Dim STR(2) As String  'IN FORM TOP
    
    Function FlagStr(FlagId As MyFlags) As String
        Static SetFlgOK As Boolean
        If SetFlgOK = False Then
            SetFlgOK = True
            STR(AAA) = "AAA"
            STR(BBB) = "BBB"
            STR(CCC) = "CCC"
        End If
        
        FlagStr = STR(FlagId)
    End Function
    
    Private Sub Form_Load()
    MsgBox FlagStr(AAA)
    MsgBox FlagStr(BBB)
    End Sub

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2020
    Posts
    447

    Re: Why can't Enum of VB6 be a string?

    Quote Originally Posted by PlausiblyDamp View Post
    An Enum is just an enumerated type, they are really nothing more than a numeric constant under the hood. The idea is that they make it easier to either auto assign numeric constants when you don't care about the actual numbers, or to group related constants together.

    Personally if I was dealing with a series of string constants I would probably just make a class to contain them all.
    If Enum of VB6 can define string-constants, it will be 10 times more convenient than defining a Class.

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

    Re: Why can't Enum of VB6 be a string?

    I just see and threat them as aliases/mnemonics for numeric values.
    If you need a kind of literal strings values then just create constants.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2020
    Posts
    447

    Re: Why can't Enum of VB6 be a string?

    Quote Originally Posted by xiaoyao View Post
    YOU CAN MAKE A STRING ARRAY()
    Code:
    Public Enum MyFlags
        AAA
        BBB
        CCC
    End Enum
    Dim STR(2) As String  'IN FORM TOP
    
    Function FlagStr(FlagId As MyFlags) As String
        Static SetFlgOK As Boolean
        If SetFlgOK = False Then
            SetFlgOK = True
            STR(AAA) = "AAA"
            STR(BBB) = "BBB"
            STR(CCC) = "CCC"
        End If
        
        FlagStr = STR(FlagId)
    End Function
    
    Private Sub Form_Load()
    MsgBox FlagStr(AAA)
    MsgBox FlagStr(BBB)
    End Sub
    Yes, your method is similar to the one I used. I handled it like this:

    Module1.bas
    Code:
    Option Explicit
    
    Public Type MyFlags
        AAA As String
        BBB As String
        CCC As String
    End Type
    
    Private m_tMyFlags As MyFlags
    
    Public Property Get MyFlags() As MyFlags
        Static bInited As Boolean
        
        If bInited = False Then
            With m_tMyFlags
                .AAA = "AAAAAA"
                .BBB = "BBBBBB"
                .CCC = "CCCCCC"
            End With
            bInited = True
        End If
        
        MyFlags = m_tMyFlags
        
    End Property
    It would be great if we could directly define Enum string constants in VB6.
    Last edited by SearchingDataOnly; Sep 6th, 2021 at 06:48 AM.

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2020
    Posts
    447

    Re: Why can't Enum of VB6 be a string?

    Quote Originally Posted by Arnoutdv View Post
    I just see and threat them as aliases/mnemonics for numeric values.
    If you need a kind of literal strings values then just create constants.
    Creating string constants will reduce the readability of the code, for example:
    Code:
    Public Const MyFlags_AAA = "AAAAAA"
    Public Const MyFlags_BBB = "BBBBBB"
    Public Const MyFlags_CCC = "CCCCCC"

  8. #8
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    4,711

    Re: Why can't Enum of VB6 be a string?

    An enum needs the same style

    Code:
    Public Enum enType1
      A = 0
      B = 1
    End Enum
    
    Public Enum enType2
      A = 16
      B = 17
    End Enum
    Code:
    Private Sub Form_Load()
      Dim i As Long
    
      ' This line will cause a compile error
      i = A '<- Ambigous name detected
      
      ' So you need this
      i = enType1.A
      i = enType2.A
    End Sub

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2020
    Posts
    447

    Re: Why can't Enum of VB6 be a string?

    enType1.A and enType2.A are more readable than enType1_A and enType2_A

  10. #10
    Frenzied Member
    Join Date
    Jan 2020
    Posts
    1,627

    Re: Why can't Enum of VB6 be a string?

    So we need an updated version of the programming IDe.Vb.net, adding thousands more features.

  11. #11
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    107,648

    Re: Why can't Enum of VB6 be a string?

    Quote Originally Posted by SearchingDataOnly View Post
    Why can't Enum of VB6 be a string?
    Because that's not how they were designed to work. End of story. They were designed to work such that they are simply numbers under the hood, so very efficient for the system to work with, while providing human-readable labels so they are also easy for the developer to work with. Your suggestion would undermine that, therefore it's a bad idea. You might find it convenient but it would break the whole reason that Enums exist so sorry, you're not important enough for that.

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2020
    Posts
    447

    Re: Why can't Enum of VB6 be a string?

    Quote Originally Posted by jmcilhinney View Post
    Because that's not how they were designed to work. End of story. They were designed to work such that they are simply numbers under the hood, so very efficient for the system to work with, while providing human-readable labels so they are also easy for the developer to work with. Your suggestion would undermine that, therefore it's a bad idea. You might find it convenient but it would break the whole reason that Enums exist so sorry, you're not important enough for that.
    Maybe you should tell the TypeScript design team that they broke the meaning of Enums.

  13. #13
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    107,648

    Re: Why can't Enum of VB6 be a string?

    Quote Originally Posted by SearchingDataOnly View Post
    Maybe you should tell the TypeScript design team that they broke the meaning of Enums.
    TypeScript has been designed to generate JavaScript and JavaScript is one of the sloppiest languages out there. TypeScript exists specifically because JavaScript is so sloppy, but it can only do so much. VB6, VB.NET, C#, etc, are very different beasts. If you want to write TypeScript code, no one here is stopping you. If you want to write VB6 code, probably don't expect it to work in a manner that would make any code that already uses Enums less efficient.

  14. #14
    Frenzied Member
    Join Date
    Jan 2020
    Posts
    1,627

    Re: Why can't Enum of VB6 be a string?

    Quote Originally Posted by SearchingDataOnly View Post
    Yes, your method is similar to the one I used. I handled it like this:

    Module1.bas
    Code:
    Option Explicit
    
    Public Type MyFlags
        AAA As String
        BBB As String
        CCC As String
    End Type
    
    Private m_tMyFlags As MyFlags
    
    Public Property Get MyFlags() As MyFlags
        Static bInited As Boolean
        
        If bInited = False Then
            With m_tMyFlags
                .AAA = "AAAAAA"
                .BBB = "BBBBBB"
                .CCC = "CCCCCC"
            End With
            bInited = True
        End If
        
        MyFlags = m_tMyFlags
        
    End Property
    It would be great if we could directly define Enum string constants in VB6.
    I think your method is better than mine.
    I used to do this. Dictionary objects are also used.For example, there are ten SIEMENS PLC to be managed on the assembly line industrial computer.Each microprocessor ah, give him a name can also be used ID operation, so it is very convenient.

  15. #15

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2020
    Posts
    447

    Re: Why can't Enum of VB6 be a string?

    There seems to be another fight here? And the moderator has cleaned up the scene?

  16. #16

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2020
    Posts
    447

    Re: Why can't Enum of VB6 be a string?

    Quote Originally Posted by jmcilhinney View Post
    TypeScript has been designed to generate JavaScript and JavaScript is one of the sloppiest languages out there. TypeScript exists specifically because JavaScript is so sloppy, but it can only do so much. VB6, VB.NET, C#, etc, are very different beasts. If you want to write TypeScript code, no one here is stopping you. If you want to write VB6 code, probably don't expect it to work in a manner that would make any code that already uses Enums less efficient.
    JavaScript is a bit sloppy, because its author wrote the first version in only 2 weeks, but the irony is that JavaScript is the most popular language in the world, and its popularity even surpasses all Microsoft languages.

    At the same time, JavaScript is also the most creative language. It seems that creativity can only be produced by some small companies.

    In my opinion, TypeScript's use of strings as enum-values does not destroy the meaning of Enums. However, TypeScript's definition of the interface (optional property) seems to completely destroy the meaning of the interface:

    Code:
    interface clothes {
        color?: string;
        size?: string;
        price?: number;
    }
    But the optional properties of the interface seem to be very useful.

  17. #17
    PowerPoster ChrisE's Avatar
    Join Date
    Jun 2017
    Location
    Frankfurt
    Posts
    2,825

    Re: [RESOLVED] Why can't Enum of VB6 be a string?

    use the proper tool for the Job

    in a Modul
    Code:
    'Module1
    
    Option Explicit
    
    Private Col As Collection
    
    Public Enum EnumString
       Enum1 = 1
       Enum2 = 2
       Enum3 = 3
       Enum4 = 4
    End Enum
    
    Private Sub FillEnum()
       Set Col = New Collection
       Col.Add "Enum1"
       Col.Add "Enum2"
       Col.Add "Enum3"
       Col.Add "Enum4"
    End Sub
    
    Public Property Get GetEnum(mEnum As EnumString) As String
    
       If Col Is Nothing Then
          FillEnum
       End If
       
       GetEnum = Col(mEnum)
    End Property
    in the form
    Code:
    Option Explicit
    
    Private Sub Command1_Click()
       Print GetEnum(Enum3)
       Print GetEnum(Enum2)
       Print GetEnum(Enum4)
       Print GetEnum(Enum1)
    End Sub
    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.

  18. #18

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2020
    Posts
    447

    Re: [RESOLVED] Why can't Enum of VB6 be a string?

    Quote Originally Posted by ChrisE View Post
    in a Modul
    Code:
    'Module1
    
    Option Explicit
    
    Private Col As Collection
    
    Public Enum EnumString
       Enum1 = 1
       Enum2 = 2
       Enum3 = 3
       Enum4 = 4
    End Enum
    
    Private Sub FillEnum()
       Set Col = New Collection
       Col.Add "Enum1"
       Col.Add "Enum2"
       Col.Add "Enum3"
       Col.Add "Enum4"
    End Sub
    
    Public Property Get GetEnum(mEnum As EnumString) As String
    
       If Col Is Nothing Then
          FillEnum
       End If
       
       GetEnum = Col(mEnum)
    End Property
    in the form
    Code:
    Option Explicit
    
    Private Sub Command1_Click()
       Print GetEnum(Enum3)
       Print GetEnum(Enum2)
       Print GetEnum(Enum4)
       Print GetEnum(Enum1)
    End Sub
    Thank you, ChrisE.

    Quote Originally Posted by ChrisE View Post
    use the proper tool for the Job
    Yes. "工欲善其事,必先利其器"

  19. #19
    Frenzied Member
    Join Date
    Dec 2012
    Posts
    1,128

    Re: Why can't Enum of VB6 be a string?

    Quote Originally Posted by jmcilhinney View Post
    Because that's not how they were designed to work. End of story. They were designed to work such that they are simply numbers under the hood, so very efficient for the system to work with, while providing human-readable labels so they are also easy for the developer to work with. Your suggestion would undermine that, therefore it's a bad idea. You might find it convenient but it would break the whole reason that Enums exist so sorry, you're not important enough for that.
    I am currently working with Javascript, and I certainly agree with you. It is a pain in the butt, and makes me appreciate VB6.

    J.A. Coutts

  20. #20

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2020
    Posts
    447

    Re: Why can't Enum of VB6 be a string?

    Quote Originally Posted by couttsj View Post
    I am currently working with Javascript, and I certainly agree with you. It is a pain in the butt, and makes me appreciate VB6.

    J.A. Coutts
    For those single-language developers who use VB6 as the main programming language, the more familiar with VB6, the more painful they will be for JavaScript syntax and programming mode.

    The main purpose of creating my own scripting language is to alleviate this pain. My scripting language is a language similar to VB6 (it's a superset of VB6), but it will be transpiled to JavaScript or TypeScript.

  21. #21
    Frenzied Member
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    1,166

    Re: [RESOLVED] Why can't Enum of VB6 be a string?

    It might be wise to create a series of VB6 polyfills (as they are wont to do in the .js world) to replicate intrinsic .js functionality in VB6, meaning you can use what ever .js/VB syntax you want in VB6 - as a starting point for your scripting language.

    lastIndexOf for example instead of instrRev.
    By the power invested in me, all the threads I start are Niya and Olaf free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.

  22. #22

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2020
    Posts
    447

    Re: [RESOLVED] Why can't Enum of VB6 be a string?

    Quote Originally Posted by yereverluvinuncleber View Post
    It might be wise to create a series of VB6 polyfills (as they are wont to do in the .js world) to replicate intrinsic .js functionality in VB6, meaning you can use what ever .js/VB syntax you want in VB6 - as a starting point for your scripting language.

    lastIndexOf for example instead of instrRev.
    That is exactly what I'm doing (but it's just a subsidiary job in addition to my main job). If RC6 could integrate these efforts, then RC6 will give VB6 a wider space for development.

    Some people maliciously speculate and attack others without knowing anything about others. *************************************
    Last edited by SearchingDataOnly; Sep 8th, 2021 at 07:57 AM.

  23. #23
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    4,711

    Re: [RESOLVED] Why can't Enum of VB6 be a string?

    I almost thought this thread would go without insults ..

  24. #24
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    36,629

    Re: Why can't Enum of VB6 be a string?

    Quote Originally Posted by SearchingDataOnly View Post
    JavaScript is a bit sloppy, because its author wrote the first version in only 2 weeks, but the irony is that JavaScript is the most popular language in the world, and its popularity even surpasses all Microsoft languages.
    JavaScript is so popular because it's the only game in town for traversing the DOM in web programming. If web wasn't so popular, I doubt JS would even register. I also think that JS could be replaced, eventually, but that's a ways off.
    My usual boring signature: Nothing

  25. #25
    Frenzied Member
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    1,166

    Re: [RESOLVED] Why can't Enum of VB6 be a string?

    Quote Originally Posted by SearchingDataOnly View Post
    Some people maliciously speculate and attack others without knowing anything about others. They think that others are stupid, but they are actually stupid.
    SDO - Niya can be a **** and he recognises this, just can't help himself. He isn't even here to wind you up. He can also be helpful and fun. There are others here that you don't like. However, YOU are part of the problem when you make snide digs like that. It is unnecessary and when you do it you are exhibiting the TROLL character that you often decry in others. Keep yourself under conTROLL.
    By the power invested in me, all the threads I start are Niya and Olaf free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.

  26. #26
    Frenzied Member
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    1,166

    Re: [RESOLVED] Why can't Enum of VB6 be a string?

    Quote Originally Posted by SearchingDataOnly View Post
    That is exactly what I'm doing (but it's just a subsidiary job in addition to my main job).
    Pleased that you are doing so.I would release them individually as polyfills for users to pick up as they require. A much more simple task than integrating here and there. You could create a thread solely for VB6/.JS polyfills and then point to the codebank/github.

    Just as Mixlangz is merging VB and Delphi/Pascal VB6 could end up with some familiar polyfills to help migration either direction.
    By the power invested in me, all the threads I start are Niya and Olaf free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.

  27. #27

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2020
    Posts
    447

    Re: [RESOLVED] Why can't Enum of VB6 be a string?

    Quote Originally Posted by Arnoutdv View Post
    I almost thought this thread would go without insults ..
    I accept your suggestion. I have deleted the unfriendly words.

  28. #28

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2020
    Posts
    447

    Re: [RESOLVED] Why can't Enum of VB6 be a string?

    Quote Originally Posted by yereverluvinuncleber View Post
    SDO - Niya can be a **** and he recognises this, just can't help himself. He isn't even here to wind you up. He can also be helpful and fun. There are others here that you don't like. However, YOU are part of the problem when you make snide digs like that. It is unnecessary and when you do it you are exhibiting the TROLL character that you often decry in others. Keep yourself under conTROLL.
    No, what I'm talking about is not Niya (he has disappeared from my list of conversations). I mean when I ask some questions about how to implement JS grammar with VB6, there are always some people who ridicule it.

    In addition, please delete my unfriendly sentence in post#25.
    Last edited by SearchingDataOnly; Sep 8th, 2021 at 08:04 AM.

  29. #29

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2020
    Posts
    447

    Re: [RESOLVED] Why can't Enum of VB6 be a string?

    Quote Originally Posted by Shaggy Hiker View Post
    JavaScript is so popular because it's the only game in town for traversing the DOM in web programming.
    This is where JavaScript is deliberately smart. The unintentional cleverness of JavaScript is its sloppy and flexible syntax. This flexible grammar design brings unlimited development space for it.

    If web wasn't so popular, I doubt JS would even register.
    This assumption is meaningless. If the web is not popular, perhaps Microsoft will not abandon VB6.

    I also think that JS could be replaced, eventually, but that's a ways off.
    Perhaps, when all Microsoft languages have been replaced, JS has not yet been replaced. Because JS is the crystallization of the open source world, but Microsoft is only partially open source.

  30. #30
    PowerPoster
    Join Date
    Feb 2017
    Posts
    3,447

    Re: [RESOLVED] Why can't Enum of VB6 be a string?

    I agree with SH, the only thing that makes JS "popular" is the monopoly, I mean, it is the only language that browsers can execute. Period.

  31. #31
    Frenzied Member
    Join Date
    Dec 2012
    Posts
    1,128

    Re: [RESOLVED] Why can't Enum of VB6 be a string?

    The best thing about VB6 is the edit and continue feature. Since JS is a script like VB6 is in the IDE, I don't see why that functionality could not be built into it. I can dream can't I?

    J.A. Coutts

  32. #32
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Posts
    3,319

    Re: [RESOLVED] Why can't Enum of VB6 be a string?

    Quote Originally Posted by couttsj View Post
    The best thing about VB6 is the edit and continue feature. Since JS is a script like VB6 is in the IDE, I don't see why that functionality could not be built into it. I can dream can't I?

    J.A. Coutts
    The only other language you can find such symbiotic REPL is Common List considered by many the most powerful programming language ever conceived.

    VBs editor keeps code semi-compiled and has E&C fearures inspired by lisp ability to introspect and self-modify code and callstack during REPL.

  33. #33
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    CT
    Posts
    18,089

    Re: [RESOLVED] Why can't Enum of VB6 be a string?

    Quote Originally Posted by couttsj View Post
    The best thing about VB6 is the edit and continue feature. Since JS is a script like VB6 is in the IDE, I don't see why that functionality could not be built into it. I can dream can't I?

    J.A. Coutts
    Chrome debugger lets you edit and continue Javascript from what I've seen online - never tried it myself.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  34. #34
    PowerPoster
    Join Date
    Feb 2006
    Posts
    22,867

    Re: [RESOLVED] Why can't Enum of VB6 be a string?

    Lisp did not inspire anything in VB6 and is hardly unique in regard to REPL. We have that today in many interpreted language systems from LUA to Node.js, and it was around in others for a very long time.

    We even had it in the old Microsoft Script Debugger and later in Microsoft Script Editor, as well as some 3rd party VBScript/JScript IDEs like VbsEdit.

  35. #35
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Posts
    3,319

    Re: [RESOLVED] Why can't Enum of VB6 be a string?

    Never heard of Edit&Continue in Lua or node i.e. putting a breakpoint, stopping execution, modifying current function and continuing with new code being executed. Is this already possible in Lua or node?

    Im positive this is not possible in VBScript without resetting context.

  36. #36
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    6,520

    Re: [RESOLVED] Why can't Enum of VB6 be a string?

    .....Do you guys like drama? I wasn't even in this thread yet SDA still trying to stir up **** with me?

    @SDA hop off my nuts kid. I'm done with you. Get on with your life and stop trying to start fires.

    Quote Originally Posted by Shaggy Hiker View Post
    JavaScript is so popular because it's the only game in town for traversing the DOM in web programming. If web wasn't so popular, I doubt JS would even register. I also think that JS could be replaced, eventually, but that's a ways off.
    Web Assembly will kill off JavaScript eventually. It can do everything JS can with the huge advantage of being capable of acting as a platform to support any language.
    Last edited by Niya; Sep 11th, 2021 at 07:21 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

    Copy/move files using Windows Shell

    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

  37. #37
    Frenzied Member
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    1,166

    Re: [RESOLVED] Why can't Enum of VB6 be a string?

    Quote Originally Posted by Niya View Post
    .....Do you guys like drama? I wasn't even in this thread yet SDA still trying to stir up **** with me?

    @SDA hop off my nuts kid. I'm done with you. Get on with your life and stop trying to start fires.
    - and yet you decided to pick up the baton and run with it. We had gently dealt with him so there is no need to shout at him over the top of your car whilst being restrained by the cops (as that is my mental picture of you now).

    Re: webassemply killing off .js, I don't think so. .js is a nice, easy language to script with, syntax is C-like, I think of it as BASIC for C.
    It is prevalent, it is known by a whole slew of Webdevs and unless there is a serious advantage in using other languages, or someone stamps on .js until it almost dies, like VB6, then I assume it will survive.
    By the power invested in me, all the threads I start are Niya and Olaf free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.

  38. #38
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,381

    Re: [RESOLVED] Why can't Enum of VB6 be a string?

    My "two cents" on the original post, enum is short for enumeration, which literally has to do with the numeric value of something.
    So an enum is used to convert a string of characters in code into a number, which makes sense.
    Converting a string of characters into another string of characters is not an enumeration, it is an aliasing or translating.

    If a dictionary is too clumsy for you to use for aliasing or translation, then I would want a different programing construct or keyword that represents this aliasing of string identifier to a string, i.e. a simple way of creating an array of related Const type declarations, rather than the devolution of the meaning of enum.
    "Anyone can do any amount of work, provided it isn't the work he is supposed to be doing at that moment" Robert Benchley, 1930

  39. #39
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    6,520

    Re: [RESOLVED] Why can't Enum of VB6 be a string?

    Quote Originally Posted by yereverluvinuncleber View Post
    - and yet you decided to pick up the baton and run with it.
    If you take shots at me and I see it, I will respond, every single time. If he sincerely wants no drama, he shouldn't start any.

    Quote Originally Posted by yereverluvinuncleber View Post
    We had gently dealt with him so there is no need to shout at him over the top of your car whilst being restrained by the cops (as that is my mental picture of you now).
    You have quite an imagination.

    Quote Originally Posted by yereverluvinuncleber View Post
    Re: webassemply killing off .js, I don't think so. .js is a nice, easy language to script with, syntax is C-like, I think of it as BASIC for C.
    It is prevalent, it is known by a whole slew of Webdevs and unless there is a serious advantage in using other languages, or someone stamps on .js until it almost dies, like VB6, then I assume it will survive.
    C# would make a better JavaScript than JavaScript. WebAssembly makes possible the use of any language. It's only a matter of time until the world settles on something better. JavaScript with it's duck typing insanity rubs a lot of people the wrong way including me.
    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

    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

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