Constant Arrays

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I have a need for something I'm about 99.999% certain VB6 doesn't support: constant arrays. Does anybody have any good workarounds for this?

Essentially what I want to do is:

Public Const LanguageNames(1 To 2) As String = ("English", "French")

The best I can come up with is either an auto-instantiating class, which seems kind of overkill, or simply declaring the array as a public variable and filling it at the beginning of my project. Unfortunately, being Access, this is not guaranteed, since the project can get reset by an error, for instance, without being fully restarted.

I'm thinking my best bet might be to declare it as a class member in my VB6 DLL, which is auto-instantiated from Access, but I'm hoping for something a little less kludgey. :)

Any thoughts?


Thanks,
Rob
.



Relevant Pages

  • Re: Constant Arrays
    ... constant arrays. ... The best I can come up with is either an auto-instantiating class, ... or simply declaring the array as a public variable ...
    (microsoft.public.vb.general.discussion)
  • Re: Constant Arrays
    ... I think I'll go with my kludge and implement it as a property in a class. ... constant arrays. ... The best I can come up with is either an auto-instantiating class, ... or simply declaring the array as a public variable ...
    (microsoft.public.vb.general.discussion)
  • Re: vb6 active-x dlls in asp.net
    ... the asax file generates a class that inherits from the code behind. ... declaring the server controls in the codebehind, ... special code to use a vb6 component in a webservice. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: VB6 - Constant Array
    ... it up as a comma delimited string, ... I've found a few Internet reference that state that, although VB6 doesn't ... support constant arrays, one can be declared as follows: ... Dim vntArray As Variant ...
    (microsoft.public.vb.general.discussion)
  • Type mismatch calling a vb6 object in vb.net
    ... I have a vb6 prject working perfecly, and i want to use it in a vb.net ... My problem is, when i am declaring a object from the vb6 dll, i'm ... getting a COMException: type mismatch error. ... I already register the dll, and i can see the methods in the dll using ...
    (microsoft.public.dotnet.framework.interop)