Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP style Macro Substitution in VB
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00529860
Message ID:
00529954
Views:
6
>I'm writing a VB class that handles opening and managing form's
>
>In VFP you can do:
>
>
>procedure openform
>lparameters cformname
>
>oform = createobject(cformname)
>oform.show()
>

>
>
>The store to object 'oForm' to an array
>
>
>In VB, I have:
>
>
>Public Sub LaunchForm(sFormName As String)
>
> Dim oForm As Form
>
> Set oForm = New sFormName
> Load oForm
> oForm.Show
>
>End Sub
>

>
>The problem is that VB doesn't know what to do with the 'sFormName'
>variable. I get a 'User-Defined data type not found' error.
>
>How do I pass in a form name to this routine?
>
>Many Thanks

Just declare the parameter as a form object and pass it the form's name (not as a string):
Public Sub LaunchForm(myForm As Form)
   myForm.Show
End Sub
call it with:
LaunchForm FormName
Previous
Reply
Map
View

Click here to load this message in the networking platform