Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Compile error: Expecte function or variable
Message
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Titre:
Compile error: Expecte function or variable
Divers
Thread ID:
00394670
Message ID:
00394670
Vues:
33
Hi Everyone,

I'm learning vb so this is probably a lame problem, but I can't figure it out.

I created a module with the following code:
Public Sub Main()
    Dim oApp As BMD_Application
    Dim lReturn As String
        
    Set oApp = New BMD_Application
    
    lReturn = oApp.test("test1", "test2")

End Sub
And a have the BMD_Application as a class with this code:
Public Sub test(arg1 As String, arg2 As String)
    Debug.Print arg1
    Debug.Print arg2

End Sub
When I try to run the code I get the error: Compiler error: Expected function or variable. on the oApp.test line? What does that mean? How do I fix it?

Also, I don't really want a return from .test but when I try to type the line a get another compile error: Expected: =

Any help would be appreciated. Thanks.
Roi
'MCP' Visual FoxPro

In Rome, there was a poem.
About a dog, who found two bone.
He lick the one, he lick the other.
He went pyscho, he drop dead!
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform