Thanks for responding. I decided to move the widget code into a class, and create a service per widget. Each service still needs to have the rv_ routines as well as wrappers for all of the layout controls click event handlers, so almost 100 lines of (nearly) identical code between each service.
Sub Process_Globals
Dim widget As APWidgetClass
End Sub
Sub Service_Create
widget.Initialize(Me)
widget.rv = ConfigureHomeWidget("awidget4x2", "rv", 0, "A Widget")
End Sub
... handlers wrappers...
Just the layout string is different between several services widgets.
Would you consider a compile time construct/change something like the following
Sub Process_Globals
Dim widgetLayouts() As String
widgetLayouts = Array As String("awidget4x2", "awidget4x1", ... "awidget1x1")
End Sub
Sub Service_Create
rv = ConfigureHomeWidget(widgetLayouts, "rv", 0, "A Widget")
End Sub
So instead of the compiler currently generating just one service, it would generate N services, one for each layout in the array?