VB6 Module Public Var Xojo Equiv

  1. 10 months ago

    Stephen P

    9 Sep 2019 Testers, Xojo Pro
    Edited 10 months ago

    Hi,

    Perhaps a simple question but I am porting a small app from VB6 to Xojo. The VB6 app has a module with some public variables declared. I used the Xojo VB6 migration tool and have worked through including setting up those variables as Public scope Xojo module properties. When I try to access them from a form:

    '// Set the # of equations to # of unknowns
    modMatrix.Eq = c

    I get a 'This item does not exist error'. I have a sneaking suspicion that I'm overlooking something very basic :-)

    Thanks in advance,
    Steve

    EDIT: modMatrix is the name of the Xojo module. Intellisense shows that Eq is a property of the module.

  2. Dave S

    9 Sep 2019 San Diego, California USA

    and what is the SCOPE of "EG"? global? private?

  3. Stephen P

    9 Sep 2019 Testers, Xojo Pro

    Public. I think your question has nade me realise that the Xojo converter changed a VB6 module to a class as there are Super and Interface properties on it.

    Away from desk atm but that seems plain confusing to change the type.

    Steve

  4. Norman P

    9 Sep 2019 Testers, Xojo Pro outside admiring the sunshine,...

    The converter doesnt do a great job FWIW

  5. Markus R

    23 Sep 2019 Testers, Xojo Pro Europe / Germany / Lower Saxon...

    if it is a class now by the converter its more like
    dim m as new modMatrix
    m.Eq = c
    a vb6 modul should be equivalent to a modul in xojo ...
    it was really a modul in vb6? should have file extension .bas , a class would be .cls
    btw global variables in vb6 is not a good thing.

  6. Stephen P

    24 Sep 2019 Testers, Xojo Pro

    Yes it was a VB6 module and tge converter changed to a class. Yes am aware of the extensions and also global vars. It was POC code being converted to Xojo.

  7. Markus R

    24 Sep 2019 Testers, Xojo Pro Europe / Germany / Lower Saxon...

    if you will leave it in a class and the variable is only used once you can use the Shared Property.
    the access would look like:

    Class1.MyValue = 5
    System.DebugLog Str(Class1.MyValue)
  8. Stephen P

    24 Sep 2019 Testers, Xojo Pro

    Thanks Markus. That's what I did - change them to shared to get it to work.

or Sign Up to reply!